From 4b215b1d97e28f2e6195f8fd350f4f274e134e49 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Mon, 22 Feb 2016 19:20:00 +0100 Subject: [PATCH] Remove files --- .../ext/eigen/doc/A05_PortingFrom2To3.dox | 304 --- .../ext/eigen/doc/A10_Eigen2SupportModes.dox | 95 - .../ext/eigen/doc/AsciiQuickReference.txt | 207 -- .../ext/eigen/doc/B01_Experimental.dox | 52 - testbed/nanogui/ext/eigen/doc/CMakeLists.txt | 98 - .../nanogui/ext/eigen/doc/ClassHierarchy.dox | 129 -- .../ext/eigen/doc/CustomizingEigen.dox | 188 -- testbed/nanogui/ext/eigen/doc/Doxyfile.in | 1875 ----------------- .../eigen/doc/Eigen_Silly_Professor_64x64.png | Bin 8355 -> 0 bytes .../ext/eigen/doc/FixedSizeVectorizable.dox | 38 - .../eigen/doc/FunctionsTakingEigenTypes.dox | 217 -- .../nanogui/ext/eigen/doc/HiPerformance.dox | 128 -- .../ext/eigen/doc/InsideEigenExample.dox | 495 ----- testbed/nanogui/ext/eigen/doc/Manual.dox | 159 -- testbed/nanogui/ext/eigen/doc/Overview.dox | 28 - .../nanogui/ext/eigen/doc/PassingByValue.dox | 40 - .../ext/eigen/doc/PreprocessorDirectives.dox | 119 -- .../nanogui/ext/eigen/doc/QuickReference.dox | 727 ------- .../nanogui/ext/eigen/doc/QuickStartGuide.dox | 100 - .../ext/eigen/doc/SparseLinearSystems.dox | 183 -- .../ext/eigen/doc/SparseQuickReference.dox | 248 --- .../nanogui/ext/eigen/doc/StlContainers.dox | 62 - .../nanogui/ext/eigen/doc/StorageOrders.dox | 86 - .../eigen/doc/StructHavingEigenMembers.dox | 190 -- .../nanogui/ext/eigen/doc/TemplateKeyword.dox | 132 -- .../nanogui/ext/eigen/doc/TopicAliasing.dox | 215 -- .../nanogui/ext/eigen/doc/TopicAssertions.dox | 108 - .../doc/TopicEigenExpressionTemplates.dox | 12 - .../ext/eigen/doc/TopicLazyEvaluation.dox | 65 - .../doc/TopicLinearAlgebraDecompositions.dox | 261 --- .../ext/eigen/doc/TopicMultithreading.dox | 46 - .../nanogui/ext/eigen/doc/TopicResizing.dox | 11 - .../ext/eigen/doc/TopicScalarTypes.dox | 12 - .../ext/eigen/doc/TopicVectorization.dox | 9 - .../doc/TutorialAdvancedInitialization.dox | 162 -- .../ext/eigen/doc/TutorialArrayClass.dox | 192 -- .../ext/eigen/doc/TutorialBlockOperations.dox | 228 -- .../ext/eigen/doc/TutorialGeometry.dox | 241 --- .../ext/eigen/doc/TutorialLinearAlgebra.dox | 255 --- .../ext/eigen/doc/TutorialMapClass.dox | 86 - .../eigen/doc/TutorialMatrixArithmetic.dox | 214 -- .../ext/eigen/doc/TutorialMatrixClass.dox | 265 --- ...TutorialReductionsVisitorsBroadcasting.dox | 257 --- .../nanogui/ext/eigen/doc/TutorialSparse.dox | 341 --- .../doc/TutorialSparse_example_details.dox | 4 - .../ext/eigen/doc/UnalignedArrayAssert.dox | 114 - .../nanogui/ext/eigen/doc/UsingIntelMKL.dox | 168 -- .../ext/eigen/doc/WrongStackAlignment.dox | 56 - .../ext/eigen/doc/eigen_navtree_hacks.js | 240 --- testbed/nanogui/ext/eigen/doc/eigendoxy.css | 211 -- .../ext/eigen/doc/eigendoxy_footer.html.in | 36 - .../ext/eigen/doc/eigendoxy_header.html.in | 61 - .../ext/eigen/doc/eigendoxy_layout.xml.in | 178 -- .../nanogui/ext/eigen/doc/eigendoxy_tabs.css | 59 - testbed/nanogui/ext/eigen/doc/examples/.krazy | 2 - .../ext/eigen/doc/examples/CMakeLists.txt | 16 - .../doc/examples/DenseBase_middleCols_int.cpp | 15 - .../doc/examples/DenseBase_middleRows_int.cpp | 15 - .../DenseBase_template_int_middleCols.cpp | 15 - .../DenseBase_template_int_middleRows.cpp | 15 - .../doc/examples/MatrixBase_cwise_const.cpp | 18 - .../eigen/doc/examples/QuickStart_example.cpp | 14 - .../examples/QuickStart_example2_dynamic.cpp | 15 - .../examples/QuickStart_example2_fixed.cpp | 15 - .../doc/examples/TemplateKeyword_flexible.cpp | 22 - .../doc/examples/TemplateKeyword_simple.cpp | 20 - .../examples/TutorialLinAlgComputeTwice.cpp | 23 - .../TutorialLinAlgExComputeSolveError.cpp | 14 - ...torialLinAlgExSolveColPivHouseholderQR.cpp | 17 - .../examples/TutorialLinAlgExSolveLDLT.cpp | 16 - .../TutorialLinAlgInverseDeterminant.cpp | 16 - .../examples/TutorialLinAlgRankRevealing.cpp | 20 - .../doc/examples/TutorialLinAlgSVDSolve.cpp | 15 - .../TutorialLinAlgSelfAdjointEigenSolver.cpp | 18 - .../examples/TutorialLinAlgSetThreshold.cpp | 16 - .../Tutorial_ArrayClass_accessors.cpp | 24 - .../examples/Tutorial_ArrayClass_addition.cpp | 23 - .../Tutorial_ArrayClass_cwise_other.cpp | 19 - .../examples/Tutorial_ArrayClass_interop.cpp | 22 - .../Tutorial_ArrayClass_interop_matrix.cpp | 26 - .../doc/examples/Tutorial_ArrayClass_mult.cpp | 16 - ...orial_BlockOperations_block_assignment.cpp | 18 - .../Tutorial_BlockOperations_colrow.cpp | 17 - .../Tutorial_BlockOperations_corner.cpp | 17 - .../Tutorial_BlockOperations_print_block.cpp | 20 - .../Tutorial_BlockOperations_vector.cpp | 14 - .../doc/examples/Tutorial_PartialLU_solve.cpp | 18 - ...ionsVisitorsBroadcasting_broadcast_1nn.cpp | 24 - ...sVisitorsBroadcasting_broadcast_simple.cpp | 21 - ...sBroadcasting_broadcast_simple_rowwise.cpp | 20 - ...ReductionsVisitorsBroadcasting_colwise.cpp | 13 - ...ReductionsVisitorsBroadcasting_maxnorm.cpp | 20 - ...nsVisitorsBroadcasting_reductions_bool.cpp | 21 - ...nsVisitorsBroadcasting_reductions_norm.cpp | 28 - ...ReductionsVisitorsBroadcasting_rowwise.cpp | 13 - ...eductionsVisitorsBroadcasting_visitors.cpp | 26 - .../Tutorial_simple_example_dynamic_size.cpp | 22 - .../Tutorial_simple_example_fixed_size.cpp | 15 - .../ext/eigen/doc/examples/class_Block.cpp | 27 - .../doc/examples/class_CwiseBinaryOp.cpp | 18 - .../eigen/doc/examples/class_CwiseUnaryOp.cpp | 19 - .../examples/class_CwiseUnaryOp_ptrfun.cpp | 20 - .../eigen/doc/examples/class_FixedBlock.cpp | 27 - .../doc/examples/class_FixedVectorBlock.cpp | 27 - .../eigen/doc/examples/class_VectorBlock.cpp | 27 - .../examples/function_taking_eigenbase.cpp | 18 - .../doc/examples/function_taking_ref.cpp | 19 - .../doc/examples/tut_arithmetic_add_sub.cpp | 22 - .../doc/examples/tut_arithmetic_dot_cross.cpp | 15 - .../examples/tut_arithmetic_matrix_mul.cpp | 19 - .../examples/tut_arithmetic_redux_basic.cpp | 16 - .../tut_arithmetic_scalar_mul_div.cpp | 17 - .../tut_matrix_coefficient_accessors.cpp | 18 - .../eigen/doc/examples/tut_matrix_resize.cpp | 18 - .../examples/tut_matrix_resize_fixed_size.cpp | 12 - testbed/nanogui/ext/eigen/doc/snippets/.krazy | 2 - .../doc/snippets/AngleAxis_mimic_euler.cpp | 5 - .../ext/eigen/doc/snippets/CMakeLists.txt | 28 - .../snippets/ColPivHouseholderQR_solve.cpp | 8 - .../snippets/ComplexEigenSolver_compute.cpp | 16 - .../ComplexEigenSolver_eigenvalues.cpp | 4 - .../ComplexEigenSolver_eigenvectors.cpp | 4 - .../doc/snippets/ComplexSchur_compute.cpp | 6 - .../doc/snippets/ComplexSchur_matrixT.cpp | 4 - .../doc/snippets/ComplexSchur_matrixU.cpp | 4 - .../ext/eigen/doc/snippets/Cwise_abs.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_abs2.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_acos.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_asin.cpp | 2 - .../eigen/doc/snippets/Cwise_boolean_and.cpp | 2 - .../eigen/doc/snippets/Cwise_boolean_or.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_cos.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_cube.cpp | 2 - .../eigen/doc/snippets/Cwise_equal_equal.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_exp.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_greater.cpp | 2 - .../doc/snippets/Cwise_greater_equal.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_inverse.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_less.cpp | 2 - .../eigen/doc/snippets/Cwise_less_equal.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_log.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_max.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_min.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_minus.cpp | 2 - .../eigen/doc/snippets/Cwise_minus_equal.cpp | 3 - .../eigen/doc/snippets/Cwise_not_equal.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_plus.cpp | 2 - .../eigen/doc/snippets/Cwise_plus_equal.cpp | 3 - .../ext/eigen/doc/snippets/Cwise_pow.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_product.cpp | 4 - .../ext/eigen/doc/snippets/Cwise_quotient.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_sin.cpp | 2 - .../eigen/doc/snippets/Cwise_slash_equal.cpp | 3 - .../ext/eigen/doc/snippets/Cwise_sqrt.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_square.cpp | 2 - .../ext/eigen/doc/snippets/Cwise_tan.cpp | 2 - .../eigen/doc/snippets/Cwise_times_equal.cpp | 3 - .../doc/snippets/DenseBase_LinSpaced.cpp | 2 - .../doc/snippets/DenseBase_LinSpaced_seq.cpp | 2 - .../doc/snippets/DenseBase_setLinSpaced.cpp | 3 - .../doc/snippets/DirectionWise_replicate.cpp | 4 - .../snippets/DirectionWise_replicate_int.cpp | 4 - .../EigenSolver_EigenSolver_MatrixType.cpp | 16 - .../doc/snippets/EigenSolver_compute.cpp | 6 - .../doc/snippets/EigenSolver_eigenvalues.cpp | 4 - .../doc/snippets/EigenSolver_eigenvectors.cpp | 4 - .../EigenSolver_pseudoEigenvectors.cpp | 9 - .../snippets/FullPivHouseholderQR_solve.cpp | 8 - .../eigen/doc/snippets/FullPivLU_image.cpp | 9 - .../eigen/doc/snippets/FullPivLU_kernel.cpp | 7 - .../eigen/doc/snippets/FullPivLU_solve.cpp | 11 - .../doc/snippets/GeneralizedEigenSolver.cpp | 7 - .../HessenbergDecomposition_compute.cpp | 6 - .../HessenbergDecomposition_matrixH.cpp | 8 - .../HessenbergDecomposition_packedMatrix.cpp | 9 - .../snippets/HouseholderQR_householderQ.cpp | 7 - .../doc/snippets/HouseholderQR_solve.cpp | 9 - ...ouseholderSequence_HouseholderSequence.cpp | 31 - .../ext/eigen/doc/snippets/IOFormat.cpp | 14 - .../eigen/doc/snippets/JacobiSVD_basic.cpp | 9 - .../eigen/doc/snippets/Jacobi_makeGivens.cpp | 6 - .../eigen/doc/snippets/Jacobi_makeJacobi.cpp | 8 - .../ext/eigen/doc/snippets/LLT_example.cpp | 12 - .../ext/eigen/doc/snippets/LLT_solve.cpp | 8 - .../eigen/doc/snippets/Map_general_stride.cpp | 5 - .../eigen/doc/snippets/Map_inner_stride.cpp | 5 - .../eigen/doc/snippets/Map_outer_stride.cpp | 3 - .../eigen/doc/snippets/Map_placement_new.cpp | 5 - .../ext/eigen/doc/snippets/Map_simple.cpp | 3 - .../eigen/doc/snippets/MatrixBase_adjoint.cpp | 3 - .../ext/eigen/doc/snippets/MatrixBase_all.cpp | 7 - .../snippets/MatrixBase_applyOnTheLeft.cpp | 7 - .../snippets/MatrixBase_applyOnTheRight.cpp | 9 - .../eigen/doc/snippets/MatrixBase_array.cpp | 4 - .../doc/snippets/MatrixBase_array_const.cpp | 4 - .../doc/snippets/MatrixBase_asDiagonal.cpp | 1 - .../doc/snippets/MatrixBase_block_int_int.cpp | 5 - .../MatrixBase_block_int_int_int_int.cpp | 5 - .../MatrixBase_bottomLeftCorner_int_int.cpp | 6 - .../MatrixBase_bottomRightCorner_int_int.cpp | 6 - .../snippets/MatrixBase_bottomRows_int.cpp | 6 - .../eigen/doc/snippets/MatrixBase_cast.cpp | 3 - .../ext/eigen/doc/snippets/MatrixBase_col.cpp | 3 - .../eigen/doc/snippets/MatrixBase_colwise.cpp | 5 - ...trixBase_computeInverseAndDetWithCheck.cpp | 13 - .../MatrixBase_computeInverseWithCheck.cpp | 11 - .../doc/snippets/MatrixBase_cwiseAbs.cpp | 4 - .../doc/snippets/MatrixBase_cwiseAbs2.cpp | 4 - .../doc/snippets/MatrixBase_cwiseEqual.cpp | 7 - .../doc/snippets/MatrixBase_cwiseInverse.cpp | 4 - .../doc/snippets/MatrixBase_cwiseMax.cpp | 2 - .../doc/snippets/MatrixBase_cwiseMin.cpp | 2 - .../doc/snippets/MatrixBase_cwiseNotEqual.cpp | 7 - .../doc/snippets/MatrixBase_cwiseProduct.cpp | 4 - .../doc/snippets/MatrixBase_cwiseQuotient.cpp | 2 - .../doc/snippets/MatrixBase_cwiseSqrt.cpp | 2 - .../doc/snippets/MatrixBase_diagonal.cpp | 4 - .../doc/snippets/MatrixBase_diagonal_int.cpp | 5 - .../MatrixBase_diagonal_template_int.cpp | 5 - .../doc/snippets/MatrixBase_eigenvalues.cpp | 3 - .../eigen/doc/snippets/MatrixBase_end_int.cpp | 5 - .../eigen/doc/snippets/MatrixBase_eval.cpp | 12 - .../eigen/doc/snippets/MatrixBase_extract.cpp | 13 - .../MatrixBase_fixedBlock_int_int.cpp | 5 - .../doc/snippets/MatrixBase_identity.cpp | 1 - .../snippets/MatrixBase_identity_int_int.cpp | 1 - .../eigen/doc/snippets/MatrixBase_inverse.cpp | 3 - .../doc/snippets/MatrixBase_isDiagonal.cpp | 6 - .../doc/snippets/MatrixBase_isIdentity.cpp | 5 - .../eigen/doc/snippets/MatrixBase_isOnes.cpp | 5 - .../doc/snippets/MatrixBase_isOrthogonal.cpp | 6 - .../doc/snippets/MatrixBase_isUnitary.cpp | 5 - .../eigen/doc/snippets/MatrixBase_isZero.cpp | 5 - .../doc/snippets/MatrixBase_leftCols_int.cpp | 6 - .../eigen/doc/snippets/MatrixBase_marked.cpp | 14 - .../eigen/doc/snippets/MatrixBase_noalias.cpp | 3 - .../eigen/doc/snippets/MatrixBase_ones.cpp | 2 - .../doc/snippets/MatrixBase_ones_int.cpp | 2 - .../doc/snippets/MatrixBase_ones_int_int.cpp | 1 - .../doc/snippets/MatrixBase_operatorNorm.cpp | 3 - .../eigen/doc/snippets/MatrixBase_part.cpp | 13 - .../eigen/doc/snippets/MatrixBase_prod.cpp | 3 - .../eigen/doc/snippets/MatrixBase_random.cpp | 1 - .../doc/snippets/MatrixBase_random_int.cpp | 1 - .../snippets/MatrixBase_random_int_int.cpp | 1 - .../doc/snippets/MatrixBase_replicate.cpp | 4 - .../snippets/MatrixBase_replicate_int_int.cpp | 4 - .../eigen/doc/snippets/MatrixBase_reverse.cpp | 8 - .../doc/snippets/MatrixBase_rightCols_int.cpp | 6 - .../ext/eigen/doc/snippets/MatrixBase_row.cpp | 3 - .../eigen/doc/snippets/MatrixBase_rowwise.cpp | 5 - .../snippets/MatrixBase_segment_int_int.cpp | 5 - .../eigen/doc/snippets/MatrixBase_select.cpp | 6 - .../ext/eigen/doc/snippets/MatrixBase_set.cpp | 13 - .../doc/snippets/MatrixBase_setIdentity.cpp | 3 - .../eigen/doc/snippets/MatrixBase_setOnes.cpp | 3 - .../doc/snippets/MatrixBase_setRandom.cpp | 3 - .../eigen/doc/snippets/MatrixBase_setZero.cpp | 3 - .../doc/snippets/MatrixBase_start_int.cpp | 5 - .../MatrixBase_template_int_bottomRows.cpp | 6 - .../snippets/MatrixBase_template_int_end.cpp | 5 - ...template_int_int_block_int_int_int_int.cpp | 5 - ...Base_template_int_int_bottomLeftCorner.cpp | 6 - ...plate_int_int_bottomLeftCorner_int_int.cpp | 6 - ...ase_template_int_int_bottomRightCorner.cpp | 6 - ...late_int_int_bottomRightCorner_int_int.cpp | 6 - ...rixBase_template_int_int_topLeftCorner.cpp | 6 - ...template_int_int_topLeftCorner_int_int.cpp | 6 - ...ixBase_template_int_int_topRightCorner.cpp | 6 - ...emplate_int_int_topRightCorner_int_int.cpp | 6 - .../MatrixBase_template_int_leftCols.cpp | 6 - .../MatrixBase_template_int_rightCols.cpp | 6 - .../MatrixBase_template_int_segment.cpp | 5 - .../MatrixBase_template_int_start.cpp | 5 - .../MatrixBase_template_int_topRows.cpp | 6 - .../MatrixBase_topLeftCorner_int_int.cpp | 6 - .../MatrixBase_topRightCorner_int_int.cpp | 6 - .../doc/snippets/MatrixBase_topRows_int.cpp | 6 - .../doc/snippets/MatrixBase_transpose.cpp | 8 - .../eigen/doc/snippets/MatrixBase_zero.cpp | 2 - .../doc/snippets/MatrixBase_zero_int.cpp | 2 - .../doc/snippets/MatrixBase_zero_int_int.cpp | 1 - .../snippets/Matrix_resize_NoChange_int.cpp | 3 - .../eigen/doc/snippets/Matrix_resize_int.cpp | 6 - .../snippets/Matrix_resize_int_NoChange.cpp | 3 - .../doc/snippets/Matrix_resize_int_int.cpp | 9 - .../doc/snippets/Matrix_setConstant_int.cpp | 3 - .../snippets/Matrix_setConstant_int_int.cpp | 3 - .../snippets/Matrix_setIdentity_int_int.cpp | 3 - .../eigen/doc/snippets/Matrix_setOnes_int.cpp | 3 - .../doc/snippets/Matrix_setOnes_int_int.cpp | 3 - .../doc/snippets/Matrix_setRandom_int.cpp | 3 - .../doc/snippets/Matrix_setRandom_int_int.cpp | 3 - .../eigen/doc/snippets/Matrix_setZero_int.cpp | 3 - .../doc/snippets/Matrix_setZero_int_int.cpp | 3 - .../eigen/doc/snippets/PartialPivLU_solve.cpp | 7 - .../eigen/doc/snippets/PartialRedux_count.cpp | 3 - .../doc/snippets/PartialRedux_maxCoeff.cpp | 3 - .../doc/snippets/PartialRedux_minCoeff.cpp | 3 - .../eigen/doc/snippets/PartialRedux_norm.cpp | 3 - .../eigen/doc/snippets/PartialRedux_prod.cpp | 3 - .../doc/snippets/PartialRedux_squaredNorm.cpp | 3 - .../eigen/doc/snippets/PartialRedux_sum.cpp | 3 - .../ext/eigen/doc/snippets/RealQZ_compute.cpp | 17 - .../RealSchur_RealSchur_MatrixType.cpp | 10 - .../eigen/doc/snippets/RealSchur_compute.cpp | 6 - ...ointEigenSolver_SelfAdjointEigenSolver.cpp | 7 - ...lver_SelfAdjointEigenSolver_MatrixType.cpp | 17 - ...ver_SelfAdjointEigenSolver_MatrixType2.cpp | 16 - ...fAdjointEigenSolver_compute_MatrixType.cpp | 7 - ...AdjointEigenSolver_compute_MatrixType2.cpp | 9 - .../SelfAdjointEigenSolver_eigenvalues.cpp | 4 - .../SelfAdjointEigenSolver_eigenvectors.cpp | 4 - ...AdjointEigenSolver_operatorInverseSqrt.cpp | 9 - .../SelfAdjointEigenSolver_operatorSqrt.cpp | 8 - .../snippets/SelfAdjointView_eigenvalues.cpp | 3 - .../snippets/SelfAdjointView_operatorNorm.cpp | 3 - .../doc/snippets/TopicAliasing_block.cpp | 7 - .../snippets/TopicAliasing_block_correct.cpp | 7 - .../doc/snippets/TopicAliasing_cwise.cpp | 20 - .../doc/snippets/TopicAliasing_mult1.cpp | 4 - .../doc/snippets/TopicAliasing_mult2.cpp | 10 - .../doc/snippets/TopicAliasing_mult3.cpp | 4 - .../snippets/TopicStorageOrders_example.cpp | 18 - ...lization_Tridiagonalization_MatrixType.cpp | 9 - .../snippets/Tridiagonalization_compute.cpp | 9 - .../Tridiagonalization_decomposeInPlace.cpp | 10 - .../snippets/Tridiagonalization_diagonal.cpp | 13 - ...iagonalization_householderCoefficients.cpp | 6 - .../Tridiagonalization_packedMatrix.cpp | 8 - .../Tutorial_AdvancedInitialization_Block.cpp | 5 - ..._AdvancedInitialization_CommaTemporary.cpp | 4 - .../Tutorial_AdvancedInitialization_Join.cpp | 11 - ...orial_AdvancedInitialization_LinSpaced.cpp | 7 - ...orial_AdvancedInitialization_ThreeWays.cpp | 20 - .../Tutorial_AdvancedInitialization_Zero.cpp | 13 - .../doc/snippets/Tutorial_Map_rowmajor.cpp | 7 - .../eigen/doc/snippets/Tutorial_Map_using.cpp | 21 - .../doc/snippets/Tutorial_commainit_01.cpp | 5 - .../doc/snippets/Tutorial_commainit_01b.cpp | 5 - .../doc/snippets/Tutorial_commainit_02.cpp | 7 - .../Tutorial_solve_matrix_inverse.cpp | 6 - .../snippets/Tutorial_solve_multiple_rhs.cpp | 10 - .../Tutorial_solve_reuse_decomposition.cpp | 13 - .../doc/snippets/Tutorial_solve_singular.cpp | 9 - .../snippets/Tutorial_solve_triangular.cpp | 8 - .../Tutorial_solve_triangular_inplace.cpp | 6 - .../eigen/doc/snippets/Vectorwise_reverse.cpp | 10 - .../eigen/doc/snippets/class_FullPivLU.cpp | 16 - .../eigen/doc/snippets/compile_snippet.cpp.in | 12 - .../snippets/tut_arithmetic_redux_minmax.cpp | 12 - .../tut_arithmetic_transpose_aliasing.cpp | 5 - .../tut_arithmetic_transpose_conjugate.cpp | 12 - .../tut_arithmetic_transpose_inplace.cpp | 6 - .../tut_matrix_assignment_resizing.cpp | 5 - .../eigen/doc/special_examples/CMakeLists.txt | 20 - .../Tutorial_sparse_example.cpp | 32 - .../Tutorial_sparse_example_details.cpp | 44 - testbed/nanogui/ext/eigen/doc/tutorial.cpp | 62 - testbed/nanogui/ext/glfw/docs/CMakeLists.txt | 5 - testbed/nanogui/ext/glfw/docs/Doxyfile.in | 1863 ---------------- .../nanogui/ext/glfw/docs/DoxygenLayout.xml | 188 -- testbed/nanogui/ext/glfw/docs/build.dox | 308 --- testbed/nanogui/ext/glfw/docs/compat.dox | 179 -- testbed/nanogui/ext/glfw/docs/compile.dox | 324 --- testbed/nanogui/ext/glfw/docs/context.dox | 329 --- testbed/nanogui/ext/glfw/docs/extra.css | 1 - testbed/nanogui/ext/glfw/docs/extra.less | 370 ---- testbed/nanogui/ext/glfw/docs/footer.html | 7 - testbed/nanogui/ext/glfw/docs/header.html | 34 - testbed/nanogui/ext/glfw/docs/input.dox | 588 ------ testbed/nanogui/ext/glfw/docs/internal.dox | 116 - testbed/nanogui/ext/glfw/docs/intro.dox | 351 --- testbed/nanogui/ext/glfw/docs/main.dox | 47 - testbed/nanogui/ext/glfw/docs/monitor.dox | 204 -- testbed/nanogui/ext/glfw/docs/moving.dox | 494 ----- testbed/nanogui/ext/glfw/docs/news.dox | 292 --- testbed/nanogui/ext/glfw/docs/quick.dox | 328 --- testbed/nanogui/ext/glfw/docs/rift.dox | 199 -- testbed/nanogui/ext/glfw/docs/spaces.svg | 872 -------- testbed/nanogui/ext/glfw/docs/window.dox | 803 ------- .../nanogui/ext/glfw/examples/CMakeLists.txt | 82 - testbed/nanogui/ext/glfw/examples/boing.c | 669 ------ testbed/nanogui/ext/glfw/examples/gears.c | 372 ---- testbed/nanogui/ext/glfw/examples/heightmap.c | 509 ----- testbed/nanogui/ext/glfw/examples/particles.c | 1061 ---------- testbed/nanogui/ext/glfw/examples/simple.c | 102 - testbed/nanogui/ext/glfw/examples/splitview.c | 505 ----- testbed/nanogui/ext/glfw/examples/wave.c | 452 ---- testbed/nanogui/ext/glfw/tests/CMakeLists.txt | 82 - testbed/nanogui/ext/glfw/tests/accuracy.c | 128 -- testbed/nanogui/ext/glfw/tests/clipboard.c | 149 -- testbed/nanogui/ext/glfw/tests/cursor.c | 288 --- testbed/nanogui/ext/glfw/tests/cursoranim.c | 135 -- testbed/nanogui/ext/glfw/tests/defaults.c | 131 -- testbed/nanogui/ext/glfw/tests/empty.c | 129 -- testbed/nanogui/ext/glfw/tests/events.c | 581 ----- testbed/nanogui/ext/glfw/tests/fsaa.c | 162 -- testbed/nanogui/ext/glfw/tests/gamma.c | 181 -- testbed/nanogui/ext/glfw/tests/glfwinfo.c | 429 ---- testbed/nanogui/ext/glfw/tests/iconify.c | 254 --- testbed/nanogui/ext/glfw/tests/joysticks.c | 235 --- testbed/nanogui/ext/glfw/tests/monitors.c | 241 --- testbed/nanogui/ext/glfw/tests/peter.c | 151 -- testbed/nanogui/ext/glfw/tests/reopen.c | 177 -- testbed/nanogui/ext/glfw/tests/sharing.c | 184 -- testbed/nanogui/ext/glfw/tests/tearing.c | 130 -- testbed/nanogui/ext/glfw/tests/threads.c | 135 -- testbed/nanogui/ext/glfw/tests/title.c | 76 - testbed/nanogui/ext/glfw/tests/windows.c | 117 - testbed/src/Gui.cpp | 23 - testbed/src/Gui.h | 17 - testbed/src/TestbedApplication.h | 2 - 413 files changed, 28509 deletions(-) delete mode 100644 testbed/nanogui/ext/eigen/doc/A05_PortingFrom2To3.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/A10_Eigen2SupportModes.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/AsciiQuickReference.txt delete mode 100644 testbed/nanogui/ext/eigen/doc/B01_Experimental.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/CMakeLists.txt delete mode 100644 testbed/nanogui/ext/eigen/doc/ClassHierarchy.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/CustomizingEigen.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/Doxyfile.in delete mode 100644 testbed/nanogui/ext/eigen/doc/Eigen_Silly_Professor_64x64.png delete mode 100644 testbed/nanogui/ext/eigen/doc/FixedSizeVectorizable.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/FunctionsTakingEigenTypes.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/HiPerformance.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/InsideEigenExample.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/Manual.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/Overview.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/PassingByValue.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/PreprocessorDirectives.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/QuickReference.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/QuickStartGuide.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/SparseLinearSystems.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/SparseQuickReference.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/StlContainers.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/StorageOrders.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/StructHavingEigenMembers.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TemplateKeyword.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicAliasing.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicAssertions.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicEigenExpressionTemplates.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicLazyEvaluation.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicLinearAlgebraDecompositions.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicMultithreading.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicResizing.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicScalarTypes.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TopicVectorization.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialAdvancedInitialization.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialArrayClass.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialBlockOperations.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialGeometry.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialLinearAlgebra.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialMapClass.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialMatrixArithmetic.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialMatrixClass.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialReductionsVisitorsBroadcasting.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialSparse.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/TutorialSparse_example_details.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/UnalignedArrayAssert.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/UsingIntelMKL.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/WrongStackAlignment.dox delete mode 100644 testbed/nanogui/ext/eigen/doc/eigen_navtree_hacks.js delete mode 100644 testbed/nanogui/ext/eigen/doc/eigendoxy.css delete mode 100644 testbed/nanogui/ext/eigen/doc/eigendoxy_footer.html.in delete mode 100644 testbed/nanogui/ext/eigen/doc/eigendoxy_header.html.in delete mode 100644 testbed/nanogui/ext/eigen/doc/eigendoxy_layout.xml.in delete mode 100644 testbed/nanogui/ext/eigen/doc/eigendoxy_tabs.css delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/.krazy delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/CMakeLists.txt delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/DenseBase_middleCols_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/DenseBase_middleRows_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleCols.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleRows.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/MatrixBase_cwise_const.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/QuickStart_example.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/QuickStart_example2_dynamic.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/QuickStart_example2_fixed.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TemplateKeyword_flexible.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TemplateKeyword_simple.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgComputeTwice.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExComputeSolveError.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgInverseDeterminant.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgRankRevealing.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSetThreshold.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_accessors.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_addition.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_cwise_other.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_interop.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_mult.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_block_assignment.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_colrow.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_corner.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_print_block.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_vector.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_PartialLU_solve.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/Tutorial_simple_example_fixed_size.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/class_Block.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/class_CwiseBinaryOp.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/class_CwiseUnaryOp.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/class_CwiseUnaryOp_ptrfun.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/class_FixedBlock.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/class_FixedVectorBlock.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/class_VectorBlock.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/function_taking_eigenbase.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/function_taking_ref.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_add_sub.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_dot_cross.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_matrix_mul.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_redux_basic.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_scalar_mul_div.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/tut_matrix_coefficient_accessors.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/tut_matrix_resize.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/examples/tut_matrix_resize_fixed_size.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/.krazy delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/AngleAxis_mimic_euler.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/CMakeLists.txt delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/ColPivHouseholderQR_solve.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_compute.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_eigenvalues.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_eigenvectors.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_compute.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_matrixT.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_matrixU.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_abs.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_abs2.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_acos.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_asin.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_boolean_and.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_boolean_or.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_cos.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_cube.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_equal_equal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_exp.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_greater.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_greater_equal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_inverse.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_less.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_less_equal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_log.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_max.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_min.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_minus.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_minus_equal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_not_equal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_plus.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_plus_equal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_pow.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_product.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_quotient.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_sin.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_slash_equal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_sqrt.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_square.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_tan.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Cwise_times_equal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/DenseBase_LinSpaced.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/DenseBase_LinSpaced_seq.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/DenseBase_setLinSpaced.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/DirectionWise_replicate.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/DirectionWise_replicate_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_compute.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_eigenvalues.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_eigenvectors.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_pseudoEigenvectors.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/FullPivHouseholderQR_solve.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_image.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_kernel.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_solve.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/GeneralizedEigenSolver.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_compute.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_matrixH.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_packedMatrix.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/HouseholderQR_householderQ.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/HouseholderQR_solve.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/HouseholderSequence_HouseholderSequence.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/IOFormat.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/JacobiSVD_basic.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Jacobi_makeGivens.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Jacobi_makeJacobi.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/LLT_example.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/LLT_solve.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Map_general_stride.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Map_inner_stride.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Map_outer_stride.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Map_placement_new.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Map_simple.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_adjoint.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_all.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_applyOnTheLeft.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_applyOnTheRight.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_array.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_array_const.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_asDiagonal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_block_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_block_int_int_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomLeftCorner_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomRightCorner_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomRows_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cast.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_col.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_colwise.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_computeInverseAndDetWithCheck.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseAbs.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseAbs2.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseEqual.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseInverse.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseMax.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseMin.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseNotEqual.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseProduct.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseQuotient.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseSqrt.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal_template_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_eigenvalues.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_end_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_eval.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_extract.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_fixedBlock_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_identity.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_identity_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_inverse.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isDiagonal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isIdentity.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isOnes.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isOrthogonal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isUnitary.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isZero.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_leftCols_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_marked.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_noalias.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_operatorNorm.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_part.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_prod.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_replicate.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_replicate_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_reverse.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_rightCols_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_row.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_rowwise.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_segment_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_select.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_set.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setIdentity.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setOnes.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setRandom.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setZero.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_start_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_bottomRows.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_end.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_block_int_int_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomRightCorner.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomRightCorner_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topLeftCorner.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topRightCorner.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_leftCols.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_rightCols.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_segment.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_start.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_topRows.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topLeftCorner_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topRightCorner_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topRows_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_transpose.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_NoChange_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int_NoChange.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setConstant_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setConstant_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setIdentity_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setOnes_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setOnes_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setRandom_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setRandom_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setZero_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Matrix_setZero_int_int.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/PartialPivLU_solve.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_count.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_maxCoeff.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_minCoeff.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_norm.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_prod.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_squaredNorm.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_sum.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/RealQZ_compute.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/RealSchur_RealSchur_MatrixType.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/RealSchur_compute.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_eigenvalues.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_eigenvectors.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_operatorInverseSqrt.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_operatorSqrt.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointView_eigenvalues.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointView_operatorNorm.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_block.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_block_correct.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_cwise.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult1.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult2.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult3.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/TopicStorageOrders_example.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_Tridiagonalization_MatrixType.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_compute.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_decomposeInPlace.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_diagonal.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_householderCoefficients.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_packedMatrix.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Block.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_CommaTemporary.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_LinSpaced.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_ThreeWays.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_Map_rowmajor.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_Map_using.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_01.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_01b.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_02.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_matrix_inverse.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_multiple_rhs.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_reuse_decomposition.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_singular.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_triangular.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_triangular_inplace.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/Vectorwise_reverse.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/class_FullPivLU.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/compile_snippet.cpp.in delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_redux_minmax.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_aliasing.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_conjugate.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_inplace.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/snippets/tut_matrix_assignment_resizing.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/special_examples/CMakeLists.txt delete mode 100644 testbed/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example_details.cpp delete mode 100644 testbed/nanogui/ext/eigen/doc/tutorial.cpp delete mode 100644 testbed/nanogui/ext/glfw/docs/CMakeLists.txt delete mode 100644 testbed/nanogui/ext/glfw/docs/Doxyfile.in delete mode 100644 testbed/nanogui/ext/glfw/docs/DoxygenLayout.xml delete mode 100644 testbed/nanogui/ext/glfw/docs/build.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/compat.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/compile.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/context.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/extra.css delete mode 100644 testbed/nanogui/ext/glfw/docs/extra.less delete mode 100644 testbed/nanogui/ext/glfw/docs/footer.html delete mode 100644 testbed/nanogui/ext/glfw/docs/header.html delete mode 100644 testbed/nanogui/ext/glfw/docs/input.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/internal.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/intro.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/main.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/monitor.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/moving.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/news.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/quick.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/rift.dox delete mode 100644 testbed/nanogui/ext/glfw/docs/spaces.svg delete mode 100644 testbed/nanogui/ext/glfw/docs/window.dox delete mode 100644 testbed/nanogui/ext/glfw/examples/CMakeLists.txt delete mode 100644 testbed/nanogui/ext/glfw/examples/boing.c delete mode 100644 testbed/nanogui/ext/glfw/examples/gears.c delete mode 100644 testbed/nanogui/ext/glfw/examples/heightmap.c delete mode 100644 testbed/nanogui/ext/glfw/examples/particles.c delete mode 100644 testbed/nanogui/ext/glfw/examples/simple.c delete mode 100644 testbed/nanogui/ext/glfw/examples/splitview.c delete mode 100644 testbed/nanogui/ext/glfw/examples/wave.c delete mode 100644 testbed/nanogui/ext/glfw/tests/CMakeLists.txt delete mode 100644 testbed/nanogui/ext/glfw/tests/accuracy.c delete mode 100644 testbed/nanogui/ext/glfw/tests/clipboard.c delete mode 100644 testbed/nanogui/ext/glfw/tests/cursor.c delete mode 100644 testbed/nanogui/ext/glfw/tests/cursoranim.c delete mode 100644 testbed/nanogui/ext/glfw/tests/defaults.c delete mode 100644 testbed/nanogui/ext/glfw/tests/empty.c delete mode 100644 testbed/nanogui/ext/glfw/tests/events.c delete mode 100644 testbed/nanogui/ext/glfw/tests/fsaa.c delete mode 100644 testbed/nanogui/ext/glfw/tests/gamma.c delete mode 100644 testbed/nanogui/ext/glfw/tests/glfwinfo.c delete mode 100644 testbed/nanogui/ext/glfw/tests/iconify.c delete mode 100644 testbed/nanogui/ext/glfw/tests/joysticks.c delete mode 100644 testbed/nanogui/ext/glfw/tests/monitors.c delete mode 100644 testbed/nanogui/ext/glfw/tests/peter.c delete mode 100644 testbed/nanogui/ext/glfw/tests/reopen.c delete mode 100644 testbed/nanogui/ext/glfw/tests/sharing.c delete mode 100644 testbed/nanogui/ext/glfw/tests/tearing.c delete mode 100644 testbed/nanogui/ext/glfw/tests/threads.c delete mode 100644 testbed/nanogui/ext/glfw/tests/title.c delete mode 100644 testbed/nanogui/ext/glfw/tests/windows.c diff --git a/testbed/nanogui/ext/eigen/doc/A05_PortingFrom2To3.dox b/testbed/nanogui/ext/eigen/doc/A05_PortingFrom2To3.dox deleted file mode 100644 index 4d5f3ae1..00000000 --- a/testbed/nanogui/ext/eigen/doc/A05_PortingFrom2To3.dox +++ /dev/null @@ -1,304 +0,0 @@ -namespace Eigen { - -/** \page Eigen2ToEigen3 Porting from Eigen2 to Eigen3 - -
Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3.
- -This page lists the most important API changes between Eigen2 and Eigen3, -and gives tips to help porting your application from Eigen2 to Eigen3. - -\eigenAutoToc - -\section CompatibilitySupport Eigen2 compatibility support - -In order to ease the switch from Eigen2 to Eigen3, Eigen3 features \subpage Eigen2SupportModes "Eigen2 support modes". - -The quick way to enable this is to define the \c EIGEN2_SUPPORT preprocessor token \b before including any Eigen header (typically it should be set in your project options). - -A more powerful, \em staged migration path is also provided, which may be useful to migrate larger projects from Eigen2 to Eigen3. This is explained in the \ref Eigen2SupportModes "Eigen 2 support modes" page. - -\section Using The USING_PART_OF_NAMESPACE_EIGEN macro - -The USING_PART_OF_NAMESPACE_EIGEN macro has been removed. In Eigen 3, just do: -\code -using namespace Eigen; -\endcode - -\section ComplexDot Dot products over complex numbers - -This is the single trickiest change between Eigen 2 and Eigen 3. It only affects code using \c std::complex numbers as scalar type. - -Eigen 2's dot product was linear in the first variable. Eigen 3's dot product is linear in the second variable. In other words, the Eigen 2 code \code x.dot(y) \endcode is equivalent to the Eigen 3 code \code y.dot(x) \endcode In yet other words, dot products are complex-conjugated in Eigen 3 compared to Eigen 2. The switch to the new convention was commanded by common usage, especially with the notation \f$ x^Ty \f$ for dot products of column-vectors. - -\section VectorBlocks Vector blocks - - - - -
Eigen 2Eigen 3
\code -vector.start(length) -vector.start() -vector.end(length) -vector.end() -\endcode\code -vector.head(length) -vector.head() -vector.tail(length) -vector.tail() -\endcode
- - -\section Corners Matrix Corners - - - - - -
Eigen 2Eigen 3
\code -matrix.corner(TopLeft,r,c) -matrix.corner(TopRight,r,c) -matrix.corner(BottomLeft,r,c) -matrix.corner(BottomRight,r,c) -matrix.corner(TopLeft) -matrix.corner(TopRight) -matrix.corner(BottomLeft) -matrix.corner(BottomRight) -\endcode\code -matrix.topLeftCorner(r,c) -matrix.topRightCorner(r,c) -matrix.bottomLeftCorner(r,c) -matrix.bottomRightCorner(r,c) -matrix.topLeftCorner() -matrix.topRightCorner() -matrix.bottomLeftCorner() -matrix.bottomRightCorner() -\endcode
- -Notice that Eigen3 also provides these new convenience methods: topRows(), bottomRows(), leftCols(), rightCols(). See in class DenseBase. - -\section CoefficientWiseOperations Coefficient wise operations - -In Eigen2, coefficient wise operations which have no proper mathematical definition (as a coefficient wise product) -were achieved using the .cwise() prefix, e.g.: -\code a.cwise() * b \endcode -In Eigen3 this .cwise() prefix has been superseded by a new kind of matrix type called -Array for which all operations are performed coefficient wise. You can easily view a matrix as an array and vice versa using -the MatrixBase::array() and ArrayBase::matrix() functions respectively. Here is an example: -\code -Vector4f a, b, c; -c = a.array() * b.array(); -\endcode -Note that the .array() function is not at all a synonym of the deprecated .cwise() prefix. -While the .cwise() prefix changed the behavior of the following operator, the array() function performs -a permanent conversion to the array world. Therefore, for binary operations such as the coefficient wise product, -both sides must be converted to an \em array as in the above example. On the other hand, when you -concatenate multiple coefficient wise operations you only have to do the conversion once, e.g.: -\code -Vector4f a, b, c; -c = a.array().abs().pow(3) * b.array().abs().sin(); -\endcode -With Eigen2 you would have written: -\code -c = (a.cwise().abs().cwise().pow(3)).cwise() * (b.cwise().abs().cwise().sin()); -\endcode - -\section PartAndExtract Triangular and self-adjoint matrices - -In Eigen 2 you had to play with the part, extract, and marked functions to deal with triangular and selfadjoint matrices. In Eigen 3, all these functions have been removed in favor of the concept of \em views: - - - - - - - - - - - - - - - -
Eigen 2Eigen 3
\code -A.part(); -A.part(); \endcode\code -A.triangularView() -A.triangularView()\endcode
\code -A.extract(); -A.extract();\endcode\code -A.triangularView() -A.triangularView()\endcode
\code -A.marked(); -A.marked();\endcode\code -A.triangularView() -A.triangularView()\endcode
\code -A.part(); -A.extract();\endcode\code -A.selfadjointView() -A.selfadjointView()\endcode
\code -UpperTriangular -LowerTriangular -UnitUpperTriangular -UnitLowerTriangular -StrictlyUpperTriangular -StrictlyLowerTriangular -\endcode\code -Upper -Lower -UnitUpper -UnitLower -StrictlyUpper -StrictlyLower -\endcode
- -\sa class TriangularView, class SelfAdjointView - -\section TriangularSolveInPlace Triangular in-place solving - - - - -
Eigen 2Eigen 3
\code A.triangularSolveInPlace(Y);\endcode\code A.triangularView().solveInPlace(Y);\endcode
- - -\section Decompositions Matrix decompositions - -Some of Eigen 2's matrix decompositions have been renamed in Eigen 3, while some others have been removed and are replaced by other decompositions in Eigen 3. - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Eigen 2Eigen 3Notes
LUFullPivLUSee also the new PartialPivLU, it's much faster
QRHouseholderQRSee also the new ColPivHouseholderQR, it's more reliable
SVDJacobiSVDWe currently don't have a bidiagonalizing SVD; of course this is planned.
EigenSolver and friends\code #include \endcode Moved to separate module
- -\section LinearSolvers Linear solvers - - - - - - - - - - - - - - - - - - -
Eigen 2Eigen 3Notes
\code A.lu();\endcode\code A.fullPivLu();\endcodeNow A.lu() returns a PartialPivLU
\code A.lu().solve(B,&X);\endcode\code X = A.lu().solve(B); - X = A.fullPivLu().solve(B);\endcodeThe returned by value is fully optimized
\code A.llt().solve(B,&X);\endcode\code X = A.llt().solve(B); - X = A.selfadjointView.llt().solve(B); - X = A.selfadjointView.llt().solve(B);\endcodeThe returned by value is fully optimized and \n -the selfadjointView API allows you to select the \n -triangular part to work on (default is lower part)
\code A.llt().solveInPlace(B);\endcode\code B = A.llt().solve(B); - B = A.selfadjointView.llt().solve(B); - B = A.selfadjointView.llt().solve(B);\endcodeIn place solving
\code A.ldlt().solve(B,&X);\endcode\code X = A.ldlt().solve(B); - X = A.selfadjointView.ldlt().solve(B); - X = A.selfadjointView.ldlt().solve(B);\endcodeThe returned by value is fully optimized and \n -the selfadjointView API allows you to select the \n -triangular part to work on
- -\section GeometryModule Changes in the Geometry module - -The Geometry module is the one that changed the most. If you rely heavily on it, it's probably a good idea to use the \ref Eigen2SupportModes "Eigen 2 support modes" to perform your migration. - -\section Transform The Transform class - -In Eigen 2, the Transform class didn't really know whether it was a projective or affine transformation. In Eigen 3, it takes a new \a Mode template parameter, which indicates whether it's \a Projective or \a Affine transform. There is no default value. - -The Transform3f (etc) typedefs are no more. In Eigen 3, the Transform typedefs explicitly refer to the \a Projective and \a Affine modes: - - - - - - - - -
Eigen 2Eigen 3Notes
Transform3f Affine3f or Projective3f Of course 3f is just an example here
- - -\section LazyVsNoalias Lazy evaluation and noalias - -In Eigen all operations are performed in a lazy fashion except the matrix products which are always evaluated into a temporary by default. -In Eigen2, lazy evaluation could be enforced by tagging a product using the .lazy() function. However, in complex expressions it was not -easy to determine where to put the lazy() function. In Eigen3, the lazy() feature has been superseded by the MatrixBase::noalias() function -which can be used on the left hand side of an assignment when no aliasing can occur. Here is an example: -\code -MatrixXf a, b, c; -... -c.noalias() += 2 * a.transpose() * b; -\endcode -However, the noalias mechanism does not cover all the features of the old .lazy(). Indeed, in some extremely rare cases, -it might be useful to explicit request for a lay product, i.e., for a product which will be evaluated one coefficient at once, on request, -just like any other expressions. To this end you can use the MatrixBase::lazyProduct() function, however we strongly discourage you to -use it unless you are sure of what you are doing, i.e., you have rigourosly measured a speed improvement. - -\section AlignMacros Alignment-related macros - -The EIGEN_ALIGN_128 macro has been renamed to EIGEN_ALIGN16. Don't be surprised, it's just that we switched to counting in bytes ;-) - -The EIGEN_DONT_ALIGN option still exists in Eigen 3, but it has a new cousin: EIGEN_DONT_ALIGN_STATICALLY. It allows to get rid of all static alignment issues while keeping alignment of dynamic-size heap-allocated arrays, thus keeping vectorization for dynamic-size objects. - -\section AlignedMap Aligned Map objects - -A common issue with Eigen 2 was that when mapping an array with Map, there was no way to tell Eigen that your array was aligned. There was a ForceAligned option but it didn't mean that; it was just confusing and has been removed. - -New in Eigen3 is the #Aligned option. See the documentation of class Map. Use it like this: -\code -Map myMappedVector(some_aligned_array); -\endcode -There also are related convenience static methods, which actually are the preferred way as they take care of such things as constness: -\code -result = Vector4f::MapAligned(some_aligned_array); -\endcode - -\section StdContainers STL Containers - -In Eigen2, #include tweaked std::vector to automatically align elements. The problem was that that was quite invasive. In Eigen3, we only override standard behavior if you use Eigen::aligned_allocator as your allocator type. So for example, if you use std::vector, you need to do the following change (note that aligned_allocator is under namespace Eigen): - - - - - - - -
Eigen 2Eigen 3
\code std::vector \endcode \code std::vector > \endcode
- -\section eiPrefix Internal ei_ prefix - -In Eigen2, global internal functions and structures were prefixed by \c ei_. In Eigen3, they all have been moved into the more explicit \c internal namespace. So, e.g., \c ei_sqrt(x) now becomes \c internal::sqrt(x). Of course it is not recommended to rely on Eigen's internal features. - - - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/A10_Eigen2SupportModes.dox b/testbed/nanogui/ext/eigen/doc/A10_Eigen2SupportModes.dox deleted file mode 100644 index f3df9151..00000000 --- a/testbed/nanogui/ext/eigen/doc/A10_Eigen2SupportModes.dox +++ /dev/null @@ -1,95 +0,0 @@ -namespace Eigen { - -/** \page Eigen2SupportModes Eigen 2 support modes - -
Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3.
- -This page documents the Eigen2 support modes, a powerful tool to help migrating your project from Eigen 2 to Eigen 3. -Don't miss our page on \ref Eigen2ToEigen3 "API changes" between Eigen 2 and Eigen 3. - -\eigenAutoToc - -\section EIGEN2_SUPPORT_Macro The quick way: define EIGEN2_SUPPORT - -By defining EIGEN2_SUPPORT before including any Eigen 3 header, you get back a large part of the Eigen 2 API, while keeping the Eigen 3 API and ABI unchanged. - -This defaults to the \ref Stage30 "stage 30" described below. - -The rest of this page describes an optional, more powerful \em staged migration path. - -\section StagedMigrationPathOverview Overview of the staged migration path - -The primary reason why EIGEN2_SUPPORT alone may not be enough to migrate a large project from Eigen 2 to Eigen 3 is that some of the Eigen 2 API is inherently incompatible with the Eigen 3 API. This happens when the same identifier is used in Eigen 2 and in Eigen 3 with different meanings. To help migrate projects that rely on such API, we provide a staged migration path allowing to perform the migration \em incrementally. - -It goes as follows: -\li Step 0: start with a project using Eigen 2. -\li Step 1: build your project against Eigen 3 with \ref Stage10 "Eigen 2 support stage 10". This mode enables maximum compatibility with the Eigen 2 API, with just a few exceptions. -\li Step 2: build your project against Eigen 3 with \ref Stage20 "Eigen 2 support stage 20". This mode forces you to add eigen2_ prefixes to the Eigen2 identifiers that conflict with Eigen 3 API. -\li Step 3: build your project against Eigen 3 with \ref Stage30 "Eigen 2 support stage 30". This mode enables the full Eigen 3 API. -\li Step 4: build your project against Eigen 3 with \ref Stage40 "Eigen 2 support stage 40". This mode enables the full Eigen 3 strictness on matters, such as const-correctness, where Eigen 2 was looser. -\li Step 5: build your project against Eigen 3 without any Eigen 2 support mode. - -\section Stage10 Stage 10: define EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API - -Enable this mode by defining the EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API preprocessor macro before including any Eigen 3 header. - -This mode maximizes support for the Eigen 2 API. As a result, it does not offer the full Eigen 3 API. Also, it doesn't offer quite 100% of the Eigen 2 API. - -The part of the Eigen 3 API that is not present in this mode, is Eigen 3's Geometry module. Indeed, this mode completely replaces it by a copy of Eigen 2's Geometry module. - -The parts of the API that are still not 100% Eigen 2 compatible in this mode are: -\li Dot products over complex numbers. Eigen 2's dot product was linear in the first variable. Eigen 3's dot product is linear in the second variable. In other words, the Eigen 2 code \code x.dot(y) \endcode is equivalent to the Eigen 3 code \code y.dot(x) \endcode In yet other words, dot products are complex-conjugated in Eigen 3 compared to Eigen 2. The switch to the new convention was commanded by common usage, especially with the notation \f$ x^Ty \f$ for dot products of column-vectors. -\li The Sparse module. -\li Certain fine details of linear algebraic decompositions. For example, LDLT decomposition is now pivoting in Eigen 3 whereas it wasn't in Eigen 2, so code that was relying on its underlying matrix structure will break. -\li Usage of Eigen types in STL containers, \ref Eigen2ToEigen3 "as explained on this page". - -\section Stage20 Stage 20: define EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS - -Enable this mode by defining the EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API preprocessor macro before including any Eigen 3 header. - -This mode removes the Eigen 2 API that is directly conflicting with Eigen 3 API. Instead, these bits of Eigen 2 API remain available with eigen2_ prefixes. The main examples of such API are: -\li the whole Geometry module. For example, replace \c Quaternion by \c eigen2_Quaternion, replace \c Transform3f by \c eigen2_Transform3f, etc. -\li the lu() method to obtain a LU decomposition. Replace by eigen2_lu(). - -There is also one more eigen2_-prefixed identifier that you should know about, even though its use is not checked at compile time by this mode: the dot() method. As was discussed above, over complex numbers, its meaning is different between Eigen 2 and Eigen 3. You can use eigen2_dot() to get the Eigen 2 behavior. - -\section Stage30 Stage 30: define EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API - -Enable this mode by defining the EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API preprocessor macro before including any Eigen 3 header. Also, this mode is what you get by default when you just define EIGEN2_SUPPORT. - -This mode gives you the full unaltered Eigen 3 API, while still keeping as much support as possible for the Eigen 2 API. - -The eigen2_-prefixed identifiers are still available, but at this stage you should now replace them by Eigen 3 identifiers. Have a look at our page on \ref Eigen2ToEigen3 "API changes" between Eigen 2 and Eigen 3. - -\section Stage40 Stage 40: define EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS - -Enable this mode by defining the EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS preprocessor macro before including any Eigen 3 header. - -This mode tightens the last bits of strictness, especially const-correctness, that had to be loosened to support what Eigen 2 allowed. For example, this code compiled in Eigen 2: -\code -const float array[4]; -x = Map(array); -\endcode -That allowed to circumvent constness. This is no longer allowed in Eigen 3. If you have to map const data in Eigen 3, map it as a const-qualified type. However, rather than explictly constructing Map objects, we strongly encourage you to use the static Map methods instead, as they take care of all of this for you: -\code -const float array[4]; -x = Vector4f::Map(array); -\endcode -This lets Eigen do the right thing for you and works equally well in Eigen 2 and in Eigen 3. - -\section FinallyDropAllEigen2Support Finally drop all Eigen 2 support - -Stage 40 is the first where it's "comfortable" to stay for a little longer period, since it preserves 100% Eigen 3 compatibility. However, we still encourage you to complete your migration as quickly as possible. While we do run the Eigen 2 test suite against Eigen 3's stage 10 support mode, we can't guarantee the same level of support and quality assurance for Eigen 2 support as we do for Eigen 3 itself, especially not in the long term. \ref Eigen2ToEigen3 "This page" describes a large part of the changes that you may need to perform. - -\section ABICompatibility What about ABI compatibility? - -It goes as follows: -\li Stage 10 already is ABI compatible with Eigen 3 for the basic (Matrix, Array, SparseMatrix...) types. However, since this stage uses a copy of Eigen 2's Geometry module instead of Eigen 3's own Geometry module, the ABI in the Geometry module is not Eigen 3 compatible. -\li Stage 20 removes the Eigen 3-incompatible Eigen 2 Geometry module (it remains available with eigen2_ prefix). So at this stage, all the identifiers that exist in Eigen 3 have the Eigen 3 ABI (and API). -\li Stage 30 introduces the remaining Eigen 3 identifiers. So at this stage, you have the full Eigen 3 ABI. -\li Stage 40 is no different than Stage 30 in these matters. - - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/AsciiQuickReference.txt b/testbed/nanogui/ext/eigen/doc/AsciiQuickReference.txt deleted file mode 100644 index b9f497f8..00000000 --- a/testbed/nanogui/ext/eigen/doc/AsciiQuickReference.txt +++ /dev/null @@ -1,207 +0,0 @@ -// A simple quickref for Eigen. Add anything that's missing. -// Main author: Keir Mierle - -#include - -Matrix A; // Fixed rows and cols. Same as Matrix3d. -Matrix B; // Fixed rows, dynamic cols. -Matrix C; // Full dynamic. Same as MatrixXd. -Matrix E; // Row major; default is column-major. -Matrix3f P, Q, R; // 3x3 float matrix. -Vector3f x, y, z; // 3x1 float matrix. -RowVector3f a, b, c; // 1x3 float matrix. -VectorXd v; // Dynamic column vector of doubles -double s; - -// Basic usage -// Eigen // Matlab // comments -x.size() // length(x) // vector size -C.rows() // size(C,1) // number of rows -C.cols() // size(C,2) // number of columns -x(i) // x(i+1) // Matlab is 1-based -C(i,j) // C(i+1,j+1) // - -A.resize(4, 4); // Runtime error if assertions are on. -B.resize(4, 9); // Runtime error if assertions are on. -A.resize(3, 3); // Ok; size didn't change. -B.resize(3, 9); // Ok; only dynamic cols changed. - -A << 1, 2, 3, // Initialize A. The elements can also be - 4, 5, 6, // matrices, which are stacked along cols - 7, 8, 9; // and then the rows are stacked. -B << A, A, A; // B is three horizontally stacked A's. -A.fill(10); // Fill A with all 10's. - -// Eigen // Matlab -MatrixXd::Identity(rows,cols) // eye(rows,cols) -C.setIdentity(rows,cols) // C = eye(rows,cols) -MatrixXd::Zero(rows,cols) // zeros(rows,cols) -C.setZero(rows,cols) // C = ones(rows,cols) -MatrixXd::Ones(rows,cols) // ones(rows,cols) -C.setOnes(rows,cols) // C = ones(rows,cols) -MatrixXd::Random(rows,cols) // rand(rows,cols)*2-1 // MatrixXd::Random returns uniform random numbers in (-1, 1). -C.setRandom(rows,cols) // C = rand(rows,cols)*2-1 -VectorXd::LinSpaced(size,low,high) // linspace(low,high,size)' -v.setLinSpaced(size,low,high) // v = linspace(low,high,size)' - - -// Matrix slicing and blocks. All expressions listed here are read/write. -// Templated size versions are faster. Note that Matlab is 1-based (a size N -// vector is x(1)...x(N)). -// Eigen // Matlab -x.head(n) // x(1:n) -x.head() // x(1:n) -x.tail(n) // x(end - n + 1: end) -x.tail() // x(end - n + 1: end) -x.segment(i, n) // x(i+1 : i+n) -x.segment(i) // x(i+1 : i+n) -P.block(i, j, rows, cols) // P(i+1 : i+rows, j+1 : j+cols) -P.block(i, j) // P(i+1 : i+rows, j+1 : j+cols) -P.row(i) // P(i+1, :) -P.col(j) // P(:, j+1) -P.leftCols() // P(:, 1:cols) -P.leftCols(cols) // P(:, 1:cols) -P.middleCols(j) // P(:, j+1:j+cols) -P.middleCols(j, cols) // P(:, j+1:j+cols) -P.rightCols() // P(:, end-cols+1:end) -P.rightCols(cols) // P(:, end-cols+1:end) -P.topRows() // P(1:rows, :) -P.topRows(rows) // P(1:rows, :) -P.middleRows(i) // P(i+1:i+rows, :) -P.middleRows(i, rows) // P(i+1:i+rows, :) -P.bottomRows() // P(end-rows+1:end, :) -P.bottomRows(rows) // P(end-rows+1:end, :) -P.topLeftCorner(rows, cols) // P(1:rows, 1:cols) -P.topRightCorner(rows, cols) // P(1:rows, end-cols+1:end) -P.bottomLeftCorner(rows, cols) // P(end-rows+1:end, 1:cols) -P.bottomRightCorner(rows, cols) // P(end-rows+1:end, end-cols+1:end) -P.topLeftCorner() // P(1:rows, 1:cols) -P.topRightCorner() // P(1:rows, end-cols+1:end) -P.bottomLeftCorner() // P(end-rows+1:end, 1:cols) -P.bottomRightCorner() // P(end-rows+1:end, end-cols+1:end) - -// Of particular note is Eigen's swap function which is highly optimized. -// Eigen // Matlab -R.row(i) = P.col(j); // R(i, :) = P(:, i) -R.col(j1).swap(mat1.col(j2)); // R(:, [j1 j2]) = R(:, [j2, j1]) - -// Views, transpose, etc; all read-write except for .adjoint(). -// Eigen // Matlab -R.adjoint() // R' -R.transpose() // R.' or conj(R') -R.diagonal() // diag(R) -x.asDiagonal() // diag(x) -R.transpose().colwise().reverse(); // rot90(R) -R.conjugate() // conj(R) - -// All the same as Matlab, but matlab doesn't have *= style operators. -// Matrix-vector. Matrix-matrix. Matrix-scalar. -y = M*x; R = P*Q; R = P*s; -a = b*M; R = P - Q; R = s*P; -a *= M; R = P + Q; R = P/s; - R *= Q; R = s*P; - R += Q; R *= s; - R -= Q; R /= s; - -// Vectorized operations on each element independently -// Eigen // Matlab -R = P.cwiseProduct(Q); // R = P .* Q -R = P.array() * s.array();// R = P .* s -R = P.cwiseQuotient(Q); // R = P ./ Q -R = P.array() / Q.array();// R = P ./ Q -R = P.array() + s.array();// R = P + s -R = P.array() - s.array();// R = P - s -R.array() += s; // R = R + s -R.array() -= s; // R = R - s -R.array() < Q.array(); // R < Q -R.array() <= Q.array(); // R <= Q -R.cwiseInverse(); // 1 ./ P -R.array().inverse(); // 1 ./ P -R.array().sin() // sin(P) -R.array().cos() // cos(P) -R.array().pow(s) // P .^ s -R.array().square() // P .^ 2 -R.array().cube() // P .^ 3 -R.cwiseSqrt() // sqrt(P) -R.array().sqrt() // sqrt(P) -R.array().exp() // exp(P) -R.array().log() // log(P) -R.cwiseMax(P) // max(R, P) -R.array().max(P.array()) // max(R, P) -R.cwiseMin(P) // min(R, P) -R.array().min(P.array()) // min(R, P) -R.cwiseAbs() // abs(P) -R.array().abs() // abs(P) -R.cwiseAbs2() // abs(P.^2) -R.array().abs2() // abs(P.^2) -(R.array() < s).select(P,Q); // (R < s ? P : Q) - -// Reductions. -int r, c; -// Eigen // Matlab -R.minCoeff() // min(R(:)) -R.maxCoeff() // max(R(:)) -s = R.minCoeff(&r, &c) // [s, i] = min(R(:)); [r, c] = ind2sub(size(R), i); -s = R.maxCoeff(&r, &c) // [s, i] = max(R(:)); [r, c] = ind2sub(size(R), i); -R.sum() // sum(R(:)) -R.colwise().sum() // sum(R) -R.rowwise().sum() // sum(R, 2) or sum(R')' -R.prod() // prod(R(:)) -R.colwise().prod() // prod(R) -R.rowwise().prod() // prod(R, 2) or prod(R')' -R.trace() // trace(R) -R.all() // all(R(:)) -R.colwise().all() // all(R) -R.rowwise().all() // all(R, 2) -R.any() // any(R(:)) -R.colwise().any() // any(R) -R.rowwise().any() // any(R, 2) - -// Dot products, norms, etc. -// Eigen // Matlab -x.norm() // norm(x). Note that norm(R) doesn't work in Eigen. -x.squaredNorm() // dot(x, x) Note the equivalence is not true for complex -x.dot(y) // dot(x, y) -x.cross(y) // cross(x, y) Requires #include - -//// Type conversion -// Eigen // Matlab -A.cast(); // double(A) -A.cast(); // single(A) -A.cast(); // int32(A) -A.real(); // real(A) -A.imag(); // imag(A) -// if the original type equals destination type, no work is done - -// Note that for most operations Eigen requires all operands to have the same type: -MatrixXf F = MatrixXf::Zero(3,3); -A += F; // illegal in Eigen. In Matlab A = A+F is allowed -A += F.cast(); // F converted to double and then added (generally, conversion happens on-the-fly) - -// Eigen can map existing memory into Eigen matrices. -float array[3]; -Vector3f::Map(array).fill(10); // create a temporary Map over array and sets entries to 10 -int data[4] = {1, 2, 3, 4}; -Matrix2i mat2x2(data); // copies data into mat2x2 -Matrix2i::Map(data) = 2*mat2x2; // overwrite elements of data with 2*mat2x2 -MatrixXi::Map(data, 2, 2) += mat2x2; // adds mat2x2 to elements of data (alternative syntax if size is not know at compile time) - -// Solve Ax = b. Result stored in x. Matlab: x = A \ b. -x = A.ldlt().solve(b)); // A sym. p.s.d. #include -x = A.llt() .solve(b)); // A sym. p.d. #include -x = A.lu() .solve(b)); // Stable and fast. #include -x = A.qr() .solve(b)); // No pivoting. #include -x = A.svd() .solve(b)); // Stable, slowest. #include -// .ldlt() -> .matrixL() and .matrixD() -// .llt() -> .matrixL() -// .lu() -> .matrixL() and .matrixU() -// .qr() -> .matrixQ() and .matrixR() -// .svd() -> .matrixU(), .singularValues(), and .matrixV() - -// Eigenvalue problems -// Eigen // Matlab -A.eigenvalues(); // eig(A); -EigenSolver eig(A); // [vec val] = eig(A) -eig.eigenvalues(); // diag(val) -eig.eigenvectors(); // vec -// For self-adjoint matrices use SelfAdjointEigenSolver<> diff --git a/testbed/nanogui/ext/eigen/doc/B01_Experimental.dox b/testbed/nanogui/ext/eigen/doc/B01_Experimental.dox deleted file mode 100644 index 5fc0ccd6..00000000 --- a/testbed/nanogui/ext/eigen/doc/B01_Experimental.dox +++ /dev/null @@ -1,52 +0,0 @@ -namespace Eigen { - -/** \page Experimental Experimental parts of Eigen - -\eigenAutoToc - -\section summary Summary - -With the 2.0 release, Eigen's API is, to a large extent, stable. However, we wish to retain the freedom to make API incompatible changes. To that effect, we call many parts of Eigen "experimental" which means that they are not subject to API stability guarantee. - -Our goal is that for the 2.1 release (expected in July 2009) most of these parts become API-stable too. - -We are aware that API stability is a major concern for our users. That's why it's a priority for us to reach it, but at the same time we're being serious about not calling Eigen API-stable too early. - -Experimental features may at any time: -\li be removed; -\li be subject to an API incompatible change; -\li introduce API or ABI incompatible changes in your own code if you let them affect your API or ABI. - -\section modules Experimental modules - -The following modules are considered entirely experimental, and we make no firm API stability guarantee about them for the time being: -\li SVD -\li QR -\li Cholesky -\li Sparse -\li Geometry (this one should be mostly stable, but it's a little too early to make a formal guarantee) - -\section core Experimental parts of the Core module - -In the Core module, the only classes subject to ABI stability guarantee (meaning that you can use it for data members in your public ABI) is: -\li Matrix -\li Map - -All other classes offer no ABI guarantee, e.g. the layout of their data can be changed. - -The only classes subject to (even partial) API stability guarantee (meaning that you can safely construct and use objects) are: -\li MatrixBase : partial API stability (see below) -\li Matrix : full API stability (except for experimental stuff inherited from MatrixBase) -\li Map : full API stability (except for experimental stuff inherited from MatrixBase) - -All other classes offer no direct API guarantee, e.g. their methods can be changed; however notice that most classes inherit MatrixBase and that this is where most of their API comes from -- so in practice most of the API is stable. - -A few MatrixBase methods are considered experimental, hence not part of any API stability guarantee: -\li all methods documented as internal -\li all methods hidden in the Doxygen documentation -\li all methods marked as experimental -\li all methods defined in experimental modules - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/CMakeLists.txt b/testbed/nanogui/ext/eigen/doc/CMakeLists.txt deleted file mode 100644 index 8a493031..00000000 --- a/testbed/nanogui/ext/eigen/doc/CMakeLists.txt +++ /dev/null @@ -1,98 +0,0 @@ -project(EigenDoc) - -set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE) - -project(EigenDoc) - -if(CMAKE_COMPILER_IS_GNUCXX) - if(CMAKE_SYSTEM_NAME MATCHES Linux) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -g1") - endif(CMAKE_SYSTEM_NAME MATCHES Linux) -endif(CMAKE_COMPILER_IS_GNUCXX) - -# Set some Doxygen flags -set(EIGEN_DOXY_PROJECT_NAME "Eigen") -set(EIGEN_DOXY_OUTPUT_DIRECTORY_SUFFIX "") -set(EIGEN_DOXY_INPUT "\"${Eigen_SOURCE_DIR}/Eigen\" \"${Eigen_SOURCE_DIR}/doc\"") -set(EIGEN_DOXY_HTML_COLORSTYLE_HUE "220") -set(EIGEN_DOXY_TAGFILES "") - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in - ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile -) - -set(EIGEN_DOXY_PROJECT_NAME "Eigen-unsupported") -set(EIGEN_DOXY_OUTPUT_DIRECTORY_SUFFIX "/unsupported") -set(EIGEN_DOXY_INPUT "\"${Eigen_SOURCE_DIR}/unsupported/Eigen\" \"${Eigen_SOURCE_DIR}/unsupported/doc\"") -set(EIGEN_DOXY_HTML_COLORSTYLE_HUE "0") -# set(EIGEN_DOXY_TAGFILES "\"${Eigen_BINARY_DIR}/doc/eigen.doxytags =../\"") -set(EIGEN_DOXY_TAGFILES "") - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in - ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-unsupported -) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/eigendoxy_header.html.in - ${CMAKE_CURRENT_BINARY_DIR}/eigendoxy_header.html -) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/eigendoxy_footer.html.in - ${CMAKE_CURRENT_BINARY_DIR}/eigendoxy_footer.html -) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/eigendoxy_layout.xml.in - ${CMAKE_CURRENT_BINARY_DIR}/eigendoxy_layout.xml -) - -configure_file( - ${Eigen_SOURCE_DIR}/unsupported/doc/eigendoxy_layout.xml.in - ${Eigen_BINARY_DIR}/doc/unsupported/eigendoxy_layout.xml -) - -set(examples_targets "") -set(snippets_targets "") - -add_definitions("-DEIGEN_MAKING_DOCS") -add_custom_target(all_examples) - -add_subdirectory(examples) -add_subdirectory(special_examples) -add_subdirectory(snippets) - -add_custom_target( - doc-eigen-prerequisites - ALL - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/html/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/eigen_navtree_hacks.js ${CMAKE_CURRENT_BINARY_DIR}/html/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Eigen_Silly_Professor_64x64.png ${CMAKE_CURRENT_BINARY_DIR}/html/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/AsciiQuickReference.txt ${CMAKE_CURRENT_BINARY_DIR}/html/ - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) - -add_custom_target( - doc-unsupported-prerequisites - ALL - COMMAND ${CMAKE_COMMAND} -E make_directory ${Eigen_BINARY_DIR}/doc/html/unsupported - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/eigen_navtree_hacks.js ${CMAKE_CURRENT_BINARY_DIR}/html/unsupported/ - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Eigen_Silly_Professor_64x64.png ${CMAKE_CURRENT_BINARY_DIR}/html/unsupported/ - WORKING_DIRECTORY ${Eigen_BINARY_DIR}/doc -) - -add_dependencies(doc-eigen-prerequisites all_snippets all_examples) -add_dependencies(doc-unsupported-prerequisites unsupported_snippets unsupported_examples) - -add_custom_target(doc ALL - COMMAND doxygen - COMMAND doxygen Doxyfile-unsupported - COMMAND ${CMAKE_COMMAND} -E rename html eigen-doc - COMMAND ${CMAKE_COMMAND} -E remove eigen-doc/eigen-doc.tgz - COMMAND ${CMAKE_COMMAND} -E tar cfz eigen-doc/eigen-doc.tgz eigen-doc - COMMAND ${CMAKE_COMMAND} -E rename eigen-doc html - WORKING_DIRECTORY ${Eigen_BINARY_DIR}/doc) - -add_dependencies(doc doc-eigen-prerequisites doc-unsupported-prerequisites) diff --git a/testbed/nanogui/ext/eigen/doc/ClassHierarchy.dox b/testbed/nanogui/ext/eigen/doc/ClassHierarchy.dox deleted file mode 100644 index 468e60a7..00000000 --- a/testbed/nanogui/ext/eigen/doc/ClassHierarchy.dox +++ /dev/null @@ -1,129 +0,0 @@ -namespace Eigen { - -/** \page TopicClassHierarchy The class hierarchy - -This page explains the design of the core classes in Eigen's class hierarchy and how they fit together. Casual -users probably need not concern themselves with these details, but it may be useful for both advanced users -and Eigen developers. - -\eigenAutoToc - - -\section TopicClassHierarchyPrinciples Principles - -Eigen's class hierarchy is designed so that virtual functions are avoided where their overhead would -significantly impair performance. Instead, Eigen achieves polymorphism with the Curiously Recurring Template -Pattern (CRTP). In this pattern, the base class (for instance, \c MatrixBase) is in fact a template class, and -the derived class (for instance, \c Matrix) inherits the base class with the derived class itself as a -template argument (in this case, \c Matrix inherits from \c MatrixBase<Matrix>). This allows Eigen to -resolve the polymorphic function calls at compile time. - -In addition, the design avoids multiple inheritance. One reason for this is that in our experience, some -compilers (like MSVC) fail to perform empty base class optimization, which is crucial for our fixed-size -types. - - -\section TopicClassHierarchyCoreClasses The core classes - -These are the classes that you need to know about if you want to write functions that accept or return Eigen -objects. - - - Matrix means plain dense matrix. If \c m is a \c %Matrix, then, for instance, \c m+m is no longer a - \c %Matrix, it is a "matrix expression". - - MatrixBase means dense matrix expression. This means that a \c %MatrixBase is something that can be - added, matrix-multiplied, LU-decomposed, QR-decomposed... All matrix expression classes, including - \c %Matrix itself, inherit \c %MatrixBase. - - Array means plain dense array. If \c x is an \c %Array, then, for instance, \c x+x is no longer an - \c %Array, it is an "array expression". - - ArrayBase means dense array expression. This means that an \c %ArrayBase is something that can be - added, array-multiplied, and on which you can perform all sorts of array operations... All array - expression classes, including \c %Array itself, inherit \c %ArrayBase. - - DenseBase means dense (matrix or array) expression. Both \c %ArrayBase and \c %MatrixBase inherit - \c %DenseBase. \c %DenseBase is where all the methods go that apply to dense expressions regardless of - whether they are matrix or array expressions. For example, the \link DenseBase::block() block(...) \endlink - methods are in \c %DenseBase. - -\section TopicClassHierarchyBaseClasses Base classes - -These classes serve as base classes for the five core classes mentioned above. They are more internal and so -less interesting for users of the Eigen library. - - - PlainObjectBase means dense (matrix or array) plain object, i.e. something that stores its own dense - array of coefficients. This is where, for instance, the \link PlainObjectBase::resize() resize() \endlink - methods go. \c %PlainObjectBase is inherited by \c %Matrix and by \c %Array. But above, we said that - \c %Matrix inherits \c %MatrixBase and \c %Array inherits \c %ArrayBase. So does that mean multiple - inheritance? No, because \c %PlainObjectBase \e itself inherits \c %MatrixBase or \c %ArrayBase depending - on whether we are in the matrix or array case. When we said above that \c %Matrix inherited - \c %MatrixBase, we omitted to say it does so indirectly via \c %PlainObjectBase. Same for \c %Array. - - DenseCoeffsBase means something that has dense coefficient accessors. It is a base class for - \c %DenseBase. The reason for \c %DenseCoeffsBase to exist is that the set of available coefficient - accessors is very different depending on whether a dense expression has direct memory access or not (the - \c DirectAccessBit flag). For example, if \c x is a plain matrix, then \c x has direct access, and - \c x.transpose() and \c x.block(...) also have direct access, because their coefficients can be read right - off memory, but for example, \c x+x does not have direct memory access, because obtaining any of its - coefficients requires a computation (an addition), it can't be just read off memory. - - EigenBase means anything that can be evaluated into a plain dense matrix or array (even if that would - be a bad idea). \c %EigenBase is really the absolute base class for anything that remotely looks like a - matrix or array. It is a base class for \c %DenseCoeffsBase, so it sits below all our dense class - hierarchy, but it is not limited to dense expressions. For example, \c %EigenBase is also inherited by - diagonal matrices, sparse matrices, etc... - - -\section TopicClassHierarchyInheritanceDiagrams Inheritance diagrams - -The inheritance diagram for Matrix looks as follows: - -
-EigenBase<%Matrix>
-  <-- DenseCoeffsBase<%Matrix>    (direct access case)
-    <-- DenseBase<%Matrix>
-      <-- MatrixBase<%Matrix>
-        <-- PlainObjectBase<%Matrix>    (matrix case)
-          <-- Matrix
-
- -The inheritance diagram for Array looks as follows: - -
-EigenBase<%Array>
-  <-- DenseCoeffsBase<%Array>    (direct access case)
-    <-- DenseBase<%Array>
-      <-- ArrayBase<%Array>
-        <-- PlainObjectBase<%Array>    (array case)
-          <-- Array
-
- -The inheritance diagram for some other matrix expression class, here denoted by \c SomeMatrixXpr, looks as -follows: - -
-EigenBase<SomeMatrixXpr>
-  <-- DenseCoeffsBase<SomeMatrixXpr>    (direct access or no direct access case)
-    <-- DenseBase<SomeMatrixXpr>
-      <-- MatrixBase<SomeMatrixXpr>
-        <-- SomeMatrixXpr
-
- -The inheritance diagram for some other array expression class, here denoted by \c SomeArrayXpr, looks as -follows: - -
-EigenBase<SomeArrayXpr>
-  <-- DenseCoeffsBase<SomeArrayXpr>    (direct access or no direct access case)
-    <-- DenseBase<SomeArrayXpr>
-      <-- ArrayBase<SomeArrayXpr>
-        <-- SomeArrayXpr
-
- -Finally, consider an example of something that is not a dense expression, for instance a diagonal matrix. The -corresponding inheritance diagram is: - -
-EigenBase<%DiagonalMatrix>
-  <-- DiagonalBase<%DiagonalMatrix>
-    <-- DiagonalMatrix
-
- - -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/CustomizingEigen.dox b/testbed/nanogui/ext/eigen/doc/CustomizingEigen.dox deleted file mode 100644 index 5a0890ea..00000000 --- a/testbed/nanogui/ext/eigen/doc/CustomizingEigen.dox +++ /dev/null @@ -1,188 +0,0 @@ -namespace Eigen { - -/** \page TopicCustomizingEigen Customizing/Extending Eigen - -Eigen can be extended in several ways, for instance, by defining global methods, \ref ExtendingMatrixBase "by adding custom methods to MatrixBase", adding support to \ref CustomScalarType "custom types" etc. - -\eigenAutoToc - -\section ExtendingMatrixBase Extending MatrixBase (and other classes) - -In this section we will see how to add custom methods to MatrixBase. Since all expressions and matrix types inherit MatrixBase, adding a method to MatrixBase make it immediately available to all expressions ! A typical use case is, for instance, to make Eigen compatible with another API. - -You certainly know that in C++ it is not possible to add methods to an existing class. So how that's possible ? Here the trick is to include in the declaration of MatrixBase a file defined by the preprocessor token \c EIGEN_MATRIXBASE_PLUGIN: -\code -class MatrixBase { - // ... - #ifdef EIGEN_MATRIXBASE_PLUGIN - #include EIGEN_MATRIXBASE_PLUGIN - #endif -}; -\endcode -Therefore to extend MatrixBase with your own methods you just have to create a file with your method declaration and define EIGEN_MATRIXBASE_PLUGIN before you include any Eigen's header file. - -You can extend many of the other classes used in Eigen by defining similarly named preprocessor symbols. For instance, define \c EIGEN_ARRAYBASE_PLUGIN if you want to extend the ArrayBase class. A full list of classes that can be extended in this way and the corresponding preprocessor symbols can be found on our page \ref TopicPreprocessorDirectives. - -Here is an example of an extension file for adding methods to MatrixBase: \n -\b MatrixBaseAddons.h -\code -inline Scalar at(uint i, uint j) const { return this->operator()(i,j); } -inline Scalar& at(uint i, uint j) { return this->operator()(i,j); } -inline Scalar at(uint i) const { return this->operator[](i); } -inline Scalar& at(uint i) { return this->operator[](i); } - -inline RealScalar squaredLength() const { return squaredNorm(); } -inline RealScalar length() const { return norm(); } -inline RealScalar invLength(void) const { return fast_inv_sqrt(squaredNorm()); } - -template -inline Scalar squaredDistanceTo(const MatrixBase& other) const -{ return (derived() - other.derived()).squaredNorm(); } - -template -inline RealScalar distanceTo(const MatrixBase& other) const -{ return internal::sqrt(derived().squaredDistanceTo(other)); } - -inline void scaleTo(RealScalar l) { RealScalar vl = norm(); if (vl>1e-9) derived() *= (l/vl); } - -inline Transpose transposed() {return this->transpose();} -inline const Transpose transposed() const {return this->transpose();} - -inline uint minComponentId(void) const { int i; this->minCoeff(&i); return i; } -inline uint maxComponentId(void) const { int i; this->maxCoeff(&i); return i; } - -template -void makeFloor(const MatrixBase& other) { derived() = derived().cwiseMin(other.derived()); } -template -void makeCeil(const MatrixBase& other) { derived() = derived().cwiseMax(other.derived()); } - -const CwiseUnaryOp, Derived> -operator+(const Scalar& scalar) const -{ return CwiseUnaryOp, Derived>(derived(), internal::scalar_add_op(scalar)); } - -friend const CwiseUnaryOp, Derived> -operator+(const Scalar& scalar, const MatrixBase& mat) -{ return CwiseUnaryOp, Derived>(mat.derived(), internal::scalar_add_op(scalar)); } -\endcode - -Then one can the following declaration in the config.h or whatever prerequisites header file of his project: -\code -#define EIGEN_MATRIXBASE_PLUGIN "MatrixBaseAddons.h" -\endcode - -\section InheritingFromMatrix Inheriting from Matrix - -Before inheriting from Matrix, be really, i mean REALLY sure that using -EIGEN_MATRIX_PLUGIN is not what you really want (see previous section). -If you just need to add few members to Matrix, this is the way to go. - -An example of when you actually need to inherit Matrix, is when you have -several layers of heritage such as MyVerySpecificVector1,MyVerySpecificVector1 -> MyVector1 -> Matrix and. -MyVerySpecificVector3,MyVerySpecificVector4 -> MyVector2 -> Matrix. - -In order for your object to work within the %Eigen framework, you need to -define a few members in your inherited class. - -Here is a minimalistic example:\n -\code -class MyVectorType : public Eigen::VectorXd -{ -public: - MyVectorType(void):Eigen::VectorXd() {} - - typedef Eigen::VectorXd Base; - - // This constructor allows you to construct MyVectorType from Eigen expressions - template - MyVectorType(const Eigen::MatrixBase& other) - : Eigen::Vector3d(other) - { } - - // This method allows you to assign Eigen expressions to MyVectorType - template - MyVectorType & operator= (const Eigen::MatrixBase & other) - { - this->Base::operator=(other); - return *this; - } -}; -\endcode - -This is the kind of error you can get if you don't provide those methods -\code -error: no match for ‘operator=’ in ‘delta = -(((Eigen::MatrixBase, 10000, 1, 2, 10000, -1> >*)(& delta)) + 8u)->Eigen::MatrixBase::cwise [with Derived = -Eigen::Matrix, 10000, 1, 2, 10000, -1>]().Eigen::Cwise::operator* [with OtherDerived = -Eigen::Matrix, 10000, 1, 2, 10000, 1>, ExpressionType = -Eigen::Matrix, 10000, 1, 2, 10000, 1>](((const -Eigen::MatrixBase, 10000, 1, 2, 10000, 1> ->&)(((const Eigen::MatrixBase, 10000, 1, ->2, 10000, 1> >*)((const spectral1d*)where)) + 8u)))’ -\endcode - -\anchor user_defined_scalars \section CustomScalarType Using custom scalar types - -By default, Eigen currently supports standard floating-point types (\c float, \c double, \c std::complex, \c std::complex, \c long \c double), as well as all native integer types (e.g., \c int, \c unsigned \c int, \c short, etc.), and \c bool. -On x86-64 systems, \c long \c double permits to locally enforces the use of x87 registers with extended accuracy (in comparison to SSE). - -In order to add support for a custom type \c T you need: --# make sure the common operator (+,-,*,/,etc.) are supported by the type \c T --# add a specialization of struct Eigen::NumTraits (see \ref NumTraits) --# define the math functions that makes sense for your type. This includes standard ones like sqrt, pow, sin, tan, conj, real, imag, etc, as well as abs2 which is Eigen specific. - (see the file Eigen/src/Core/MathFunctions.h) - -The math function should be defined in the same namespace than \c T, or in the \c std namespace though that second approach is not recommended. - -Here is a concrete example adding support for the Adolc's \c adouble type. Adolc is an automatic differentiation library. The type \c adouble is basically a real value tracking the values of any number of partial derivatives. - -\code -#ifndef ADOLCSUPPORT_H -#define ADOLCSUPPORT_H - -#define ADOLC_TAPELESS -#include -#include - -namespace Eigen { - -template<> struct NumTraits - : NumTraits // permits to get the epsilon, dummy_precision, lowest, highest functions -{ - typedef adtl::adouble Real; - typedef adtl::adouble NonInteger; - typedef adtl::adouble Nested; - - enum { - IsComplex = 0, - IsInteger = 0, - IsSigned = 1, - RequireInitialization = 1, - ReadCost = 1, - AddCost = 3, - MulCost = 3 - }; -}; - -} - -namespace adtl { - -inline const adouble& conj(const adouble& x) { return x; } -inline const adouble& real(const adouble& x) { return x; } -inline adouble imag(const adouble&) { return 0.; } -inline adouble abs(const adouble& x) { return fabs(x); } -inline adouble abs2(const adouble& x) { return x*x; } - -} - -#endif // ADOLCSUPPORT_H -\endcode - - -\sa \ref TopicPreprocessorDirectives - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/Doxyfile.in b/testbed/nanogui/ext/eigen/doc/Doxyfile.in deleted file mode 100644 index 1a2603b0..00000000 --- a/testbed/nanogui/ext/eigen/doc/Doxyfile.in +++ /dev/null @@ -1,1875 +0,0 @@ -# Doxyfile 1.8.1.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = ${EIGEN_DOXY_PROJECT_NAME} - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -# EIGEN_VERSION is set in the root CMakeLists.txt - -PROJECT_NUMBER = "${EIGEN_VERSION}" - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = "${Eigen_SOURCE_DIR}/doc/Eigen_Silly_Professor_64x64.png" - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = "${Eigen_BINARY_DIR}/doc${EIGEN_DOXY_OUTPUT_DIRECTORY_SUFFIX}" - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = YES - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = "only_for_vectors=This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column." \ - "array_module=This is defined in the %Array module. \code #include \endcode" \ - "cholesky_module=This is defined in the %Cholesky module. \code #include \endcode" \ - "eigenvalues_module=This is defined in the %Eigenvalues module. \code #include \endcode" \ - "geometry_module=This is defined in the %Geometry module. \code #include \endcode" \ - "householder_module=This is defined in the %Householder module. \code #include \endcode" \ - "jacobi_module=This is defined in the %Jacobi module. \code #include \endcode" \ - "lu_module=This is defined in the %LU module. \code #include \endcode" \ - "qr_module=This is defined in the %QR module. \code #include \endcode" \ - "svd_module=This is defined in the %SVD module. \code #include \endcode" \ - "label=\bug" \ - "matrixworld=*" \ - "arrayworld=*" \ - "note_about_arbitrary_choice_of_solution=If there exists more than one solution, this method will arbitrarily choose one." \ - "note_about_using_kernel_to_study_multiple_solutions=If you need a complete analysis of the space of solutions, take the one solution obtained by this method and add to it elements of the kernel, as determined by kernel()." \ - "note_about_checking_solutions=This method just tries to find as good a solution as possible. If you want to check whether a solution exists or if it is accurate, just call this function to get a result and then compute the error of this result, or use MatrixBase::isApprox() directly, for instance like this: \code bool a_solution_exists = (A*result).isApprox(b, precision); \endcode This method avoids dividing by zero, so that the non-existence of a solution doesn't by itself mean that you'll get \c inf or \c nan values." \ - "note_try_to_help_rvo=This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization)." \ - "nonstableyet=\warning This is not considered to be part of the stable public API yet. Changes may happen in future releases. See \ref Experimental \"Experimental parts of Eigen\" - -ALIASES += "eigenAutoToc= " -ALIASES += "eigenManualPage=\defgroup" - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields will be shown inline in the documentation -# of the scope in which they are defined (i.e. file, namespace, or group -# documentation), provided this scope is documented. If set to NO (the default), -# structs, classes, and unions are shown on a separate page (for HTML and Man -# pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -SYMBOL_CACHE_SIZE = 0 - -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = YES - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = YES - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = YES - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = YES - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = NO - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = NO - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = NO - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= NO - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 0 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = "${Eigen_BINARY_DIR}/doc${EIGEN_DOXY_OUTPUT_DIRECTORY_SUFFIX}/eigendoxy_layout.xml" - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = NO - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ${EIGEN_DOXY_INPUT} - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = * - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = "${Eigen_SOURCE_DIR}/Eigen/Eigen2Support" \ - "${Eigen_SOURCE_DIR}/Eigen/src/Eigen2Support" \ - "${Eigen_SOURCE_DIR}/doc/examples" \ - "${Eigen_SOURCE_DIR}/doc/special_examples" \ - "${Eigen_SOURCE_DIR}/doc/snippets" \ - "${Eigen_SOURCE_DIR}/unsupported/doc/examples" \ - "${Eigen_SOURCE_DIR}/unsupported/doc/snippets" - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = CMake* \ - *.txt \ - *.sh \ - *.orig \ - *.diff \ - diff \ - *~ \ - *. \ - *.sln \ - *.sdf \ - *.tmp \ - *.vcxproj \ - *.filters \ - *.user \ - *.suo - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = internal::* \ - Flagged* \ - *InnerIterator* \ - DenseStorage<* \ - - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = "${Eigen_SOURCE_DIR}/doc/snippets" \ - "${Eigen_BINARY_DIR}/doc/snippets" \ - "${Eigen_SOURCE_DIR}/doc/examples" \ - "${Eigen_BINARY_DIR}/doc/examples" \ - "${Eigen_SOURCE_DIR}/doc/special_examples" \ - "${Eigen_BINARY_DIR}/doc/special_examples" \ - "${Eigen_SOURCE_DIR}/unsupported/doc/snippets" \ - "${Eigen_BINARY_DIR}/unsupported/doc/snippets" \ - "${Eigen_SOURCE_DIR}/unsupported/doc/examples" \ - "${Eigen_BINARY_DIR}/unsupported/doc/examples" - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = "${Eigen_BINARY_DIR}/doc/html${EIGEN_DOXY_OUTPUT_DIRECTORY_SUFFIX}" - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = "${Eigen_BINARY_DIR}/doc/eigendoxy_header.html" - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = "${Eigen_BINARY_DIR}/doc/eigendoxy_footer.html" - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# style sheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = "${Eigen_SOURCE_DIR}/doc/eigendoxy.css" - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. -# The default is 220. - -HTML_COLORSTYLE_HUE = ${EIGEN_DOXY_HTML_COLORSTYLE_HUE} - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. - -HTML_DYNAMIC_SECTIONS = YES - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = YES - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 1 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 12 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. -# However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = amssymb \ - amsmath - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = "${Eigen_SOURCE_DIR}/Eigen/src/plugins" - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = EIGEN_EMPTY_STRUCT \ - EIGEN_PARSED_BY_DOXYGEN \ - EIGEN_VECTORIZE \ - EIGEN_QT_SUPPORT \ - EIGEN_STRONG_INLINE=inline \ - "EIGEN2_SUPPORT_STAGE=99" \ - "EIGEN_MAKE_CWISE_BINARY_OP(METHOD,FUNCTOR)=template const CwiseBinaryOp, const Derived, const OtherDerived> METHOD(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const;" \ - "EIGEN_CWISE_PRODUCT_RETURN_TYPE(LHS,RHS)=CwiseBinaryOp, const LHS, const RHS>" - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = EIGEN_MAKE_TYPEDEFS \ - EIGEN_MAKE_FIXED_TYPEDEFS \ - EIGEN_MAKE_TYPEDEFS_ALL_SIZES \ - EIGEN_CWISE_UNOP_RETURN_TYPE \ - EIGEN_CWISE_BINOP_RETURN_TYPE \ - EIGEN_CURRENT_STORAGE_BASE_CLASS \ - EIGEN_MATHFUNC_IMPL \ - _EIGEN_GENERIC_PUBLIC_INTERFACE \ - EIGEN2_SUPPORT - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths -# or URLs. Note that each tag file must have a unique name (where the name does -# NOT include the path). If a tag file is not located in the directory in which -# doxygen is run, you must also specify the path to the tagfile here. - -TAGFILES = ${EIGEN_DOXY_TAGFILES} -# "${Eigen_BINARY_DIR}/doc/eigen-unsupported.doxytags =unsupported" - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = "${Eigen_BINARY_DIR}/doc/${EIGEN_DOXY_PROJECT_NAME}.doxytags" - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = NO - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = NO - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = NO - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = YES - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# managable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = NO - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = NO - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = NO - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/testbed/nanogui/ext/eigen/doc/Eigen_Silly_Professor_64x64.png b/testbed/nanogui/ext/eigen/doc/Eigen_Silly_Professor_64x64.png deleted file mode 100644 index 079d45b1d2bb6a2fca3ef0253850d92f480d294c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8355 zcmV;UAY9*xP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iON2 z3o#9|IIMyI03ZNKL_t(|+TELZ&}L^@=6}!goc-Ot_x<+nuREPiy3^@SXMvEIu!Bh% zPys~-1Qc;Bw_>bvW=c!PQm1Adov|!u+(w;6r$il>!co8lL=X@m5EHVeyOZ?S-QWJb z``Mpm{&+h|VSr8;tkF~T{`3BE>O9xEm+QLj`zZbqU2)vF`{ebv{6w#}xN`XL(dp^a zFBqOX_qhFX?kWB;0icvRaMj^s_g!_>HOpx>DVvSv2Zi9>VHAC^-JaY3?ce?%&lwE$ zj|l)NRS^ckZA;4sPI{i_2`P>nt-nzS-ZY&~u8!kmdv|wx7qI^%0dUURzzx0Gd}({%drf06)PPTGBI%GZ-z zqj^ia-Tk%Q-OcQZqUs;p`Rlscou-rjE(I)x_^)e5O735 z56A%X4*`I+)(Jr+rFu)8G`xccmk2|jG|e&AQP;J|vb34!`EO`lxvyvhthVJ_Pb{gA zA74$n!iI$IYle*h_=JM+lhfwm5m}TI#wY&r>|lzcoo3r?2RK zUk(7fsr^+Y<%?gm=G`+$#SOXU?N*3~9^KYIJ1O1o0Q#9on~TJe#fEtGwBi;aNIXgC zE3WaR7=?kzrR0eVeRE-4xF?L|0qYoEj;v?iqKM<w<3x3U@lQazCe0{w02ko!_4yFdg(rUp)N}8(rM{F5h(G{ za!3Bk!wCMGg@cn>=#SX`hU(1I+^f6Xe4lo`MKJ)Oy z_rIhlvf?XEgu-j)<$IdGxa;b!R0n&WnA9+rNG7>uYpBhM1y3cR!1pE1M6%RYgn=Lk z6}bT=z*x}6(Vu9Z+^KnbPa}Y4C_zGzTRwH(K>H8^Nt#Y6%AD2JLj-<^b&j{a?Tx(e zeSb!))upbh$>WbdbkD}d`p3W0ZO}v>$LAAqqc+4&J5f}YtgytsAdo^j2bG&u$;vqL z(xI(jdt|A#psb+MFr6B*+|mjKp#&ua$`c%(_o!3N_Rylk4y{&)Ac&ZzV}y`28*SR{ z4q@nX+ifr6i6_pYlozDwWH=b?ec(9*aQEGJ&%N@MuY7x+=i|M-z5bU(z%sFpQ`)j7 zK?NWhYF1$fxx+|7;7g{Zq$)j%(lMAA(!wz+1ho->BrPmwwrX_k$Vx{N3J!D>);L6M z=}!&&u0gN2gp`6TPbrFwg@t9BjV3EA3*2$XZJd94o&EiR$n$g|&$Hjvx}IKf7Z5`D zx88c|_rKu{Z}<;MlDzgxLLk?i*_ygv_LR7{v}D8DIi&>J!I4Fu>y~{kO%g_pn=#=j zHnw}L_nXuugi4{LM_CERIrvhdH3R|@307N_bvOZw33XK#lO&1hc6+QHyb7&rw62j# zqLk$Q@B34(x%M!V$pB;Q)nORlb;S`dpU7h`ebwE!yz`y!{INg!qd&Uz-uJ%u-&kuW zSAaoj9A`R_&_aqEyNO(wOO!aYawX0|~75&QR*c*O`yI%K37CLR#R#&*=<*z_{9-sQ?UvOl> z=QG=ad*1c$dF%InKWis%WP5wcxu-93?Xuv>zGksA>llx1)@qoWN`_6bu&^9xtKakxv%51O&kHVXT%zCaQ1N*d z-ajOC6TE9*#lQZ6A7W`?fdfac;igx7HJ^QQlhK7o@I6OXITl-z?V%QXnJst5#f2nk zE;;KctCCvRXk9THPEaa9>zcBxNz)Y1^Wrp}o-sy$@{87h*SzL6!8`uNj~+d7;=1yM z2ke1P=)UhtiPEW6Ph8!T-+rL2j<*7VCj`y{PO!Lkly0j@Hx6j{iqKQ|0(>F3{l#}O zG9lmjuJ0$1f=1}mjsh0u+I;;tzm2%jWU1wGc;2J5f|UiIwVv1Q`1z;Lo_nlcRweCD zhlPbDc6YbY8v28M@*)SI(P&|ekwFl?Q3%obq5#}=*Inr)U;Yo?H7O6budl6SH1uQfblhRT-K_`*&)+64{x=cTm=PA?4m@J)A z6gfM)Ta;yq6au3)MV{fT!}I(XN~v!AqEvWyclQUr^Ef=IDFoS?0vHWn!a&N|-mwzngKi1+^2 zAEvW%gd1->%?&4x6D0}bq9U&i=N|qHi%E^tV4VZ!xVT%hH8S*CQkG@)>-+uP*EEu5 zqP52NLy97!(P(04q6p_44o46~Q4oap6ovVibIv|%4M?Zyy&GrmKOZT(e4wKabsLJ6 zwrXro%uS_spD>QIUxZC2Ng&>M{jzs0)(NW}o)lQ2m}rkvuYMDr=iwau{_p)BANt@2 zc;IjD ze&y$Xj<MTS}Zn%D#H@xn}TzvRXc<{kp%35$~OOZ4K zmV+rb9rOvPnM^8nM>QAsHAU@sq;Ef!X*MRMd;6rMl2ZLh6eUNTbK|Ni&PP$>-*q}Y z|CxhDQB1SdWNxm_?#7u%`orO!Tf3vtv&msQDcxTi$Gbd%98WYwZdvMjoIVtUL9Bk@ z;q|h3a!-FEuiVDx0dOylPf00GS?iW+ix5(PcI@{HuI+uj3Uj z4ET$4dpy-}*semu)2 z_OcPG>Z&+Z*X0|Xbw0ukw5j&Slm5BQOU3SW2jr_p{lfo(et@=o_>pb%S8HAMlBIdY zxjjQx)g116oLmX!c7~c4T;>1p$In#X`*{GYueRm=)6yo^InhFpLEkGQFr zYXx-U27}DdX(&b)ALUoyGvwgv90?x7vgAllQcP!sFqE@;H7*?zxG-`1sU|Hn4;9)y z<3N2b!!z2LclG-_KMf+3lD%$sak{dyHa`2reMj@Mxm46P|6*dOs0`z@bZXZ*kV)MDB<-I{JShlg9jJF+b->uzhC_wcz+K73-m)zysjI|1*HTB+7hQ7Mmt)eWLmoL z=(2Zr;E8M2`{qHQ4=@*tcrSIYTyDv(l0y1QP}h*xjX#BydgRR)@& zpt3@=BB4v|uB$EQtz+<909adYyt&s2AAjVj$)~@RC+M~&_TAeP``W9!^6TSB2qob& z8=6y#3h7%MaAd&~orC^?mmUqi?c9$3wu=L8or6LB+FzF8|D@|D&u37RhwZIn+W1zMUCj=cUgp_M{>VLP;x>)Ize*OX&6*%ykmFa|!KEi<^(ngQ@B7Pw>!mLPs}&W+Dj# ziRVd@P|*kk?N}g{APfZyO*OweHFxHf+wmo5wEg0vFacMeJlcKxIIDlPPNCSKrSjYU@_RaKJ&79}m(Se%8db_5=11J*dSgTR->p(OFdQiS{JSUJBJ zac{r)f+USb>|K5O_`(Z5`QXlPPBX2q*b}U@JL5@S6iAME0=l7KxuxhOg4#kOyj852YyK^zmr2}!ew3Vf93VT{FEgNLOkYkXzN3Qb;GoC75V zh?#0rQqTw`!`#veK$j-=aWBm@QK{_6*K-us+P(b6zYEB9$D z#NEAy=otgXIuc)i6VwJmU*LHH>t@9&@@D^QD-fQ~+*|`Mis*D(#LXsABLU$N#4&yp zfso``ffSCa)<`UqTvJq*BoG9ipxsbNPtb@YaUk*J40I2Ogp-LUZY`a-cQ=1_y|U2q zPGRfm`R(Gq=j;mSnq6(#JT&j!(~Lz>8wZzrx^*xu9icA>Bp3tE0YaiYA3q9NSZvd5 zH)*w7NI$|40=ytV`2j)&NGZwklE7Ce;i$@*x~eHlL+p!L+w^9#+EaoskXSpbd~q!4 zM3R2tyxfWF(~AFH8p_W{B6AOtHPwgA513M!| zWR;_?-AsEcNi7sRxuDx?ad5RutJA`dWBf2eDuq-E<@sclq1kFu8wh;Gv@rbD!+Y3T z6H13KVK1|I5~LKA7HSJ|ATVy0c5@AdA1d~9x9m&$yQ%vOumGgbJpWwFe*r@7_Q&=5 z^PLNrap^uP;q|_xcU4#6NkJ3{d`~dW9ln4tki?14Lpz2$Pc5>tJcscj=I7h^VTg0` zZ}pewd-y>>5Jf02Kq-Omd01oEALSfg@G;tuSC$W-De0${Q8B9v#zHHUl%+*VSX~I{ zHI#U8qrTO4JKxh>XudTYW`7Rsb(%qV>e$jhf6=L>wcURDiP5yy&j$d2DY)0%vKCw$ z`GRMvpQj|gFX+UQRx6;@ikQ?MH=bDH$vur1MI2o1;Rg}c&P*sFBwiR0Co!HMAU%mt zGp-Q&iodvji`8yS`n}onL)TT z=dm~+(wk41SPwrA2^$T@r6VgXMjPs~yu9Wjky0WMI6(OUVbmaMvHf zI(LW4c+d|Y&qIn?4e-K{Ad2zh1QkT!z#4et3tkvw5<5DiQWI7z@FRb#^ZS72!7TW%=pWi75 z&viV0YcCe3thVHO*6X`XNw4G4Zh8pMCut;jaf?Oc7}XNx2OL=GvRGS`@1vBDu@0#u z)@YoYMWM3>t7~SqpT+kTPppqPcA!f~m3Y!}elx|Hf~>HFmnrsz6q^2wp{7-hRRW_e zD_x%`*Z5vTc2+y@ID4W0$f2dExNxCN1+Jl#>H+7TD*$%{l9n@2Xvb<#G2iuRG-lE^ ziUNcm;l~LrCuqo!FiBWy_%tGKW`;V!1CL+img`or&S8x~*A=SrL20a+0Z?m8T55)c z=FX!cUrP3^Z0Kl;_b* zLX_ttmB%=(IJ-W;SxZ$LoO77Ermia{;}mN&!U+OT^3q$crqOH=HCxp9M7~1$9%C<} zURkAg)jU?gPf>90gkzjLd*&JJrt@xycMIc0Kg&Jl0llxQiTYF>uOFP3VeNG!9 z0@`ztxPG}M!~WEApd&F3s>;z0XZQ_r$5JPx(THg`OWfsRCj{Uu4nbblXlljW9S1*J-U6hb`Vtc<1byoi>ume=jDFT$_kdg$2#x;UjyVDjb?dU{;ac;>&SJvD$+9gr`+Vry&{Sj)yK)954k!Th^{$6Gv`2 za!=R{@BF-#n=1oATb3N6sElJS5fpkRdIAAu=@=K5g|?3n0x1M1j`Xn3;Y^LGE37d% z>yW~6`{_f(jRd89s@k%#J;WM=QXWcqSmUTJ`vP$kFr60EmB#ZF1d3KHi9?^oZopc* zMbb=Y_L?N~39jMu(QSCF^k@VUQEL)i(dxBWym~Qcue5(0!O`c+1Ql>-ZBD+v8Hg26 z36TVXT03G1wE-&?OT7j`6k?IQ{}UIu>F6AxwA59FvlizZVHnVE1eXV~j;Aj6dEkjn zu3ekMS%WbaB_&218lhr;I3*AoTNMoYQy#oH<GXKF+T%C*>b}ZW??k0Ak=|?2DJLw$*CrLBkj9jSW7q zlRFkV0qtgl=lgh`LR-h)AmczUoRLLwIoHL^;Bao%7B}`L^am-&4$aNd#944|CXFRr z*w_bM5_ypLh9}OC*vJghDvljpLf17_Zn@YW61QWbIKq#8f;fa;o2ZizF87ehjAM)j zBdoL65xeuPjS(pMa4CNmnQEsrTNq6 zQUjbP+4H2>9p<)jj#(Z?k}weD+EKfiL=6HDD;0yZX08=7Q^g9TByPksT1|wMSR6)I zG-Ac^!(DV$pv#QuB<0MLTj(;UDsrw_O_0u@gaK!mivhadO|DX5By$zVc%r_cV=`}>#fzx0FYUiubb`?&z13eD=q$evy8C^N1d zm4ncicuEijicTY-+lnww(29MIEH{V)Z#EkDe8Momk7JM?#yPCDr;I`%E_$)lVSydl>K8A>|Eqg+6Q{;<* zu^ewk(kqR?^L?!Jh~tQjL4k9Q(Kx3rD>ip0taW{qbO>k2rxS{4N|9ygx}vTsbY0@= ziZaWvb;X=-(M8T+m~rOf6lXQ_iJ+_ugXygE_?|#Y*q$14<5*j2bKt-tz8CP}KYzef zS@lS|oxZ7USbx*v;$64jcq3~kPx5D*o7D6@{Iw#N28PqLOQd0$sM zh(p1~pyXH*F`i`TTF@V+w0z6ac?nvPjYhb-L>DPSDs(+#dmyNcB@V#WHC0jJd7#S* zUDZsolE=16POmD;(y+d-sY}a#Ze2H)LP%KlHS3r5`OCk0nDM0G{U7+7&zRDDU%i_> zf@4s}v9w2z;s*g|AAFGA!C<%gyu)8901mL$@$~N0-g#ioIg3DB$B7l6$TJK_DV2r& zeZ$rBitT>RLhLZ5BAZSb4@aaGM7|{O6JaB4}qou{?C_x>kEv3{;T(H4V4$NhUh_;^(TG__vpKmItMbdHbb z`Se0r{?7DSrbt&RhZ{gYugPld9*=yI?TNXr*Qj}Fuj16fgh8s=AJ>e8U^1%EnIPA2 zd^uoRm$=Kz(9J-Qm$UWR1M?w;adZ-ekbK-%~wf@d*Jmy~K_=vUdoxr_c&i4Y-%Sx&glAqij+jn*o zIse2~b#Aq-Zl6pts@zg#n!X0CV^lypkqo9ao+p@Oma=lFh9n9V6)?#v5Q2#{Xa}XX z45ym1H1wwir39D8mQ%}$^CL&3W>(}vB&cd@N2Rl#61thFjY9Klm7xa2q7d(Tp;Gru zfQPKzKL`Ku^Htz;1;7Cpfj=2$?z0=iI&1{u{l~8E-X%nCAGuiCP9#;Koj99X=SjrD zmLx45#u}u6ac)^?DhlIfgHP+&n_8>`ryb2uFfC>W&r8R!bO`@GziHqvKJY|kfZ(tYUz=IW)6VgfbB_XN{$H)jZ}u~%rXt6og=F-GgdzrOq>6lNX2m>Jog`?Y$lp4~) zQkIr!ZYc{xnpyJ7Q5aAj>}Jl@7CYBa?%>*-^&(H~jD<%9&%WcW zFFf3B*3sFGV*Ojc<<@R78Q8ymYs>m=4Lavz1Mqjk>{^lkg_**ZlmPyb_<^G2NUk% zcJ{9vU&d{DIG>?4p>3Zk=4;A(2t+_l>3E|p7aQ#ZF6)lg)>dCV7o^)<=&pF@1 z{m&R9U(P2p0+2$Wa9ro$N#I!IA!@@J<4A!Q0&}fMOpPU3Xox2wPrPhrV%7wVUv$uG zUYfc$AD)x!PVLS^+vZF!k%LL;9-EXdyJ1ayYoyc+i;FOyT2v1uyw5pekP>l$iam1dSteqN5~7PAtefTA_I7 z*PaZ%vlokbAy{5&ijEY7KnQ#@u=qLm3ZBO^c`Z10NQl?@@CyEa`e3}Z!oYU`000+B tL_t&+3;BwpzW>i|3cpY)hF|Fi{=Yt %EigenBase Example

-Prints the dimensions of the most generic object present in %Eigen. It could be any matrix expressions, any dense or sparse matrix and any array. - - - -
Example:Output:
-\include function_taking_eigenbase.cpp - -\verbinclude function_taking_eigenbase.out -
- %DenseBase Example

-Prints a sub-block of the dense expression. Accepts any dense matrix or array expression, but no sparse objects and no special matrix classes such as DiagonalMatrix. -\code -template -void print_block(const DenseBase& b, int x, int y, int r, int c) -{ - std::cout << "block: " << b.block(x,y,r,c) << std::endl; -} -\endcode - %ArrayBase Example

-Prints the maximum coefficient of the array or array-expression. -\code -template -void print_max_coeff(const ArrayBase &a) -{ - std::cout << "max: " << a.maxCoeff() << std::endl; -} -\endcode - %MatrixBase Example

-Prints the inverse condition number of the given matrix or matrix-expression. -\code -template -void print_inv_cond(const MatrixBase& a) -{ - const typename JacobiSVD::SingularValuesType& - sing_vals = a.jacobiSvd().singularValues(); - std::cout << "inv cond: " << sing_vals(sing_vals.size()-1) / sing_vals(0) << std::endl; -} -\endcode - Multiple templated arguments example

-Calculate the Euclidean distance between two points. -\code -template -typename DerivedA::Scalar squaredist(const MatrixBase& p1,const MatrixBase& p2) -{ - return (p1-p2).squaredNorm(); -} -\endcode -Notice that we used two template parameters, one per argument. This permits the function to handle inputs of different types, e.g., -\code -squaredist(v1,2*v2) -\endcode -where the first argument \c v1 is a vector and the second argument \c 2*v2 is an expression. -

- -These examples are just intended to give the reader a first impression of how functions can be written which take a plain and constant Matrix or Array argument. They are also intended to give the reader an idea about the most common base classes being the optimal candidates for functions. In the next section we will look in more detail at an example and the different ways it can be implemented, while discussing each implementation's problems and advantages. For the discussion below, Matrix and Array as well as MatrixBase and ArrayBase can be exchanged and all arguments still hold. - - -\section TopicUsingRefClass How to write generic, but non-templated function? - -In all the previous examples, the functions had to be template functions. This approach allows to write very generic code, but it is often desirable to write non templated function and still keep some level of genericity to avoid stupid copies of the arguments. The typical example is to write functions accepting both a MatrixXf or a block of a MatrixXf. This exactly the purpose of the Ref class. Here is a simple example: - - - - -
Example:Output:
-\include function_taking_ref.cpp - -\verbinclude function_taking_ref.out -
-In the first two calls to inv_cond, no copy occur because the memory layout of the arguments matches the memory layout accepted by Ref. However, in the last call, we have a generic expression that will be automatically evaluated into a temporary MatrixXf by the Ref<> object. - -A Ref object can also be writable. Here is an example of a function computing the covariance matrix of two input matrices where each row is an observation: -\code -void cov(const Ref x, const Ref y, Ref C) -{ - const float num_observations = static_cast(x.rows()); - const RowVectorXf x_mean = x.colwise().sum() / num_observations; - const RowVectorXf y_mean = y.colwise().sum() / num_observations; - C = (x.rowwise() - x_mean).transpose() * (y.rowwise() - y_mean) / num_observations; -} -\endcode -and here are two examples calling cov without any copy: -\code -MatrixXf m1, m2, m3 -cov(m1, m2, m3); -cov(m1.leftCols<3>(), m2.leftCols<3>(), m3.topLeftCorner<3,3>()); -\endcode -The Ref<> class has two other optional template arguments allowing to control the kind of memory layout that can be accepted without any copy. See the class Ref documentation for the details. - -\section TopicPlainFunctionsWorking In which cases do functions taking plain Matrix or Array arguments work? - -Without using template functions, and without the Ref class, a naive implementation of the previous cov function might look like this -\code -MatrixXf cov(const MatrixXf& x, const MatrixXf& y) -{ - const float num_observations = static_cast(x.rows()); - const RowVectorXf x_mean = x.colwise().sum() / num_observations; - const RowVectorXf y_mean = y.colwise().sum() / num_observations; - return (x.rowwise() - x_mean).transpose() * (y.rowwise() - y_mean) / num_observations; -} -\endcode -and contrary to what one might think at first, this implementation is fine unless you require a generic implementation that works with double matrices too and unless you do not care about temporary objects. Why is that the case? Where are temporaries involved? How can code as given below compile? -\code -MatrixXf x,y,z; -MatrixXf C = cov(x,y+z); -\endcode -In this special case, the example is fine and will be working because both parameters are declared as \e const references. The compiler creates a temporary and evaluates the expression x+z into this temporary. Once the function is processed, the temporary is released and the result is assigned to C. - -\b Note: Functions taking \e const references to Matrix (or Array) can process expressions at the cost of temporaries. - - -\section TopicPlainFunctionsFailing In which cases do functions taking a plain Matrix or Array argument fail? - -Here, we consider a slightly modified version of the function given above. This time, we do not want to return the result but pass an additional non-const paramter which allows us to store the result. A first naive implementation might look as follows. -\code -// Note: This code is flawed! -void cov(const MatrixXf& x, const MatrixXf& y, MatrixXf& C) -{ - const float num_observations = static_cast(x.rows()); - const RowVectorXf x_mean = x.colwise().sum() / num_observations; - const RowVectorXf y_mean = y.colwise().sum() / num_observations; - C = (x.rowwise() - x_mean).transpose() * (y.rowwise() - y_mean) / num_observations; -} -\endcode -When trying to execute the following code -\code -MatrixXf C = MatrixXf::Zero(3,6); -cov(x,y, C.block(0,0,3,3)); -\endcode -the compiler will fail, because it is not possible to convert the expression returned by \c MatrixXf::block() into a non-const \c MatrixXf&. This is the case because the compiler wants to protect you from writing your result to a temporary object. In this special case this protection is not intended -- we want to write to a temporary object. So how can we overcome this problem? - -The solution which is preferred at the moment is based on a little \em hack. One needs to pass a const reference to the matrix and internally the constness needs to be cast away. The correct implementation for C98 compliant compilers would be -\code -template -void cov(const MatrixBase& x, const MatrixBase& y, MatrixBase const & C) -{ - typedef typename Derived::Scalar Scalar; - typedef typename internal::plain_row_type::type RowVectorType; - - const Scalar num_observations = static_cast(x.rows()); - - const RowVectorType x_mean = x.colwise().sum() / num_observations; - const RowVectorType y_mean = y.colwise().sum() / num_observations; - - const_cast< MatrixBase& >(C) = - (x.rowwise() - x_mean).transpose() * (y.rowwise() - y_mean) / num_observations; -} -\endcode -The implementation above does now not only work with temporary expressions but it also allows to use the function with matrices of arbitrary floating point scalar types. - -\b Note: The const cast hack will only work with templated functions. It will not work with the MatrixXf implementation because it is not possible to cast a Block expression to a Matrix reference! - - - -\section TopicResizingInGenericImplementations How to resize matrices in generic implementations? - -One might think we are done now, right? This is not completely true because in order for our covariance function to be generically applicable, we want the follwing code to work -\code -MatrixXf x = MatrixXf::Random(100,3); -MatrixXf y = MatrixXf::Random(100,3); -MatrixXf C; -cov(x, y, C); -\endcode -This is not the case anymore, when we are using an implementation taking MatrixBase as a parameter. In general, %Eigen supports automatic resizing but it is not possible to do so on expressions. Why should resizing of a matrix Block be allowed? It is a reference to a sub-matrix and we definitely don't want to resize that. So how can we incorporate resizing if we cannot resize on MatrixBase? The solution is to resize the derived object as in this implementation. -\code -template -void cov(const MatrixBase& x, const MatrixBase& y, MatrixBase const & C_) -{ - typedef typename Derived::Scalar Scalar; - typedef typename internal::plain_row_type::type RowVectorType; - - const Scalar num_observations = static_cast(x.rows()); - - const RowVectorType x_mean = x.colwise().sum() / num_observations; - const RowVectorType y_mean = y.colwise().sum() / num_observations; - - MatrixBase& C = const_cast< MatrixBase& >(C_); - - C.derived().resize(x.cols(),x.cols()); // resize the derived object - C = (x.rowwise() - x_mean).transpose() * (y.rowwise() - y_mean) / num_observations; -} -\endcode -This implementation is now working for parameters being expressions and for parameters being matrices and having the wrong size. Resizing the expressions does not do any harm in this case unless they actually require resizing. That means, passing an expression with the wrong dimensions will result in a run-time error (in debug mode only) while passing expressions of the correct size will just work fine. - -\b Note: In the above discussion the terms Matrix and Array and MatrixBase and ArrayBase can be exchanged and all arguments still hold. - -\section TopicSummary Summary - - - To summarize, the implementation of functions taking non-writable (const referenced) objects is not a big issue and does not lead to problematic situations in terms of compiling and running your program. However, a naive implementation is likely to introduce unnecessary temporary objects in your code. In order to avoid evaluating parameters into temporaries, pass them as (const) references to MatrixBase or ArrayBase (so templatize your function). - - - Functions taking writable (non-const) parameters must take const references and cast away constness within the function body. - - - Functions that take as parameters MatrixBase (or ArrayBase) objects, and potentially need to resize them (in the case where they are resizable), must call resize() on the derived class, as returned by derived(). -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/HiPerformance.dox b/testbed/nanogui/ext/eigen/doc/HiPerformance.dox deleted file mode 100644 index ab6cdfd4..00000000 --- a/testbed/nanogui/ext/eigen/doc/HiPerformance.dox +++ /dev/null @@ -1,128 +0,0 @@ - -namespace Eigen { - -/** \page TopicWritingEfficientProductExpression Writing efficient matrix product expressions - -In general achieving good performance with Eigen does no require any special effort: -simply write your expressions in the most high level way. This is especially true -for small fixed size matrices. For large matrices, however, it might be useful to -take some care when writing your expressions in order to minimize useless evaluations -and optimize the performance. -In this page we will give a brief overview of the Eigen's internal mechanism to simplify -and evaluate complex product expressions, and discuss the current limitations. -In particular we will focus on expressions matching level 2 and 3 BLAS routines, i.e, -all kind of matrix products and triangular solvers. - -Indeed, in Eigen we have implemented a set of highly optimized routines which are very similar -to BLAS's ones. Unlike BLAS, those routines are made available to user via a high level and -natural API. Each of these routines can compute in a single evaluation a wide variety of expressions. -Given an expression, the challenge is then to map it to a minimal set of routines. -As explained latter, this mechanism has some limitations, and knowing them will allow -you to write faster code by making your expressions more Eigen friendly. - -\section GEMM General Matrix-Matrix product (GEMM) - -Let's start with the most common primitive: the matrix product of general dense matrices. -In the BLAS world this corresponds to the GEMM routine. Our equivalent primitive can -perform the following operation: -\f$ C.noalias() += \alpha op1(A) op2(B) \f$ -where A, B, and C are column and/or row major matrices (or sub-matrices), -alpha is a scalar value, and op1, op2 can be transpose, adjoint, conjugate, or the identity. -When Eigen detects a matrix product, it analyzes both sides of the product to extract a -unique scalar factor alpha, and for each side, its effective storage order, shape, and conjugation states. -More precisely each side is simplified by iteratively removing trivial expressions such as scalar multiple, -negation and conjugation. Transpose and Block expressions are not evaluated and they only modify the storage order -and shape. All other expressions are immediately evaluated. -For instance, the following expression: -\code m1.noalias() -= s4 * (s1 * m2.adjoint() * (-(s3*m3).conjugate()*s2)) \endcode -is automatically simplified to: -\code m1.noalias() += (s1*s2*conj(s3)*s4) * m2.adjoint() * m3.conjugate() \endcode -which exactly matches our GEMM routine. - -\subsection GEMM_Limitations Limitations -Unfortunately, this simplification mechanism is not perfect yet and not all expressions which could be -handled by a single GEMM-like call are correctly detected. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Not optimal expressionEvaluated asOptimal version (single evaluation)Comments
\code -m1 += m2 * m3; \endcode\code -temp = m2 * m3; -m1 += temp; \endcode\code -m1.noalias() += m2 * m3; \endcodeUse .noalias() to tell Eigen the result and right-hand-sides do not alias. - Otherwise the product m2 * m3 is evaluated into a temporary.
\code -m1.noalias() += s1 * (m2 * m3); \endcodeThis is a special feature of Eigen. Here the product between a scalar - and a matrix product does not evaluate the matrix product but instead it - returns a matrix product expression tracking the scalar scaling factor.
- Without this optimization, the matrix product would be evaluated into a - temporary as in the next example.
\code -m1.noalias() += (m2 * m3).adjoint(); \endcode\code -temp = m2 * m3; -m1 += temp.adjoint(); \endcode\code -m1.noalias() += m3.adjoint() -* * m2.adjoint(); \endcodeThis is because the product expression has the EvalBeforeNesting bit which - enforces the evaluation of the product by the Tranpose expression.
\code -m1 = m1 + m2 * m3; \endcode\code -temp = m2 * m3; -m1 = m1 + temp; \endcode\code m1.noalias() += m2 * m3; \endcodeHere there is no way to detect at compile time that the two m1 are the same, - and so the matrix product will be immediately evaluated.
\code -m1.noalias() = m4 + m2 * m3; \endcode\code -temp = m2 * m3; -m1 = m4 + temp; \endcode\code -m1 = m4; -m1.noalias() += m2 * m3; \endcodeFirst of all, here the .noalias() in the first expression is useless because - m2*m3 will be evaluated anyway. However, note how this expression can be rewritten - so that no temporary is required. (tip: for very small fixed size matrix - it is slighlty better to rewrite it like this: m1.noalias() = m2 * m3; m1 += m4;
\code -m1.noalias() += (s1*m2).block(..) * m3; \endcode\code -temp = (s1*m2).block(..); -m1 += temp * m3; \endcode\code -m1.noalias() += s1 * m2.block(..) * m3; \endcodeThis is because our expression analyzer is currently not able to extract trivial - expressions nested in a Block expression. Therefore the nested scalar - multiple cannot be properly extracted.
- -Of course all these remarks hold for all other kind of products involving triangular or selfadjoint matrices. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/InsideEigenExample.dox b/testbed/nanogui/ext/eigen/doc/InsideEigenExample.dox deleted file mode 100644 index ed053c69..00000000 --- a/testbed/nanogui/ext/eigen/doc/InsideEigenExample.dox +++ /dev/null @@ -1,495 +0,0 @@ -namespace Eigen { - -/** \page TopicInsideEigenExample What happens inside Eigen, on a simple example - -\eigenAutoToc - -
- - -Consider the following example program: - -\code -#include - -int main() -{ - int size = 50; - // VectorXf is a vector of floats, with dynamic size. - Eigen::VectorXf u(size), v(size), w(size); - u = v + w; -} -\endcode - -The goal of this page is to understand how Eigen compiles it, assuming that SSE2 vectorization is enabled (GCC option -msse2). - -\section WhyInteresting Why it's interesting - -Maybe you think, that the above example program is so simple, that compiling it shouldn't involve anything interesting. So before starting, let us explain what is nontrivial in compiling it correctly -- that is, producing optimized code -- so that the complexity of Eigen, that we'll explain here, is really useful. - -Look at the line of code -\code - u = v + w; // (*) -\endcode - -The first important thing about compiling it, is that the arrays should be traversed only once, like -\code - for(int i = 0; i < size; i++) u[i] = v[i] + w[i]; -\endcode -The problem is that if we make a naive C++ library where the VectorXf class has an operator+ returning a VectorXf, then the line of code (*) will amount to: -\code - VectorXf tmp = v + w; - VectorXf u = tmp; -\endcode -Obviously, the introduction of the temporary \a tmp here is useless. It has a very bad effect on performance, first because the creation of \a tmp requires a dynamic memory allocation in this context, and second as there are now two for loops: -\code - for(int i = 0; i < size; i++) tmp[i] = v[i] + w[i]; - for(int i = 0; i < size; i++) u[i] = tmp[i]; -\endcode -Traversing the arrays twice instead of once is terrible for performance, as it means that we do many redundant memory accesses. - -The second important thing about compiling the above program, is to make correct use of SSE2 instructions. Notice that Eigen also supports AltiVec and that all the discussion that we make here applies also to AltiVec. - -SSE2, like AltiVec, is a set of instructions allowing to perform computations on packets of 128 bits at once. Since a float is 32 bits, this means that SSE2 instructions can handle 4 floats at once. This means that, if correctly used, they can make our computation go up to 4x faster. - -However, in the above program, we have chosen size=50, so our vectors consist of 50 float's, and 50 is not a multiple of 4. This means that we cannot hope to do all of that computation using SSE2 instructions. The second best thing, to which we should aim, is to handle the 48 first coefficients with SSE2 instructions, since 48 is the biggest multiple of 4 below 50, and then handle separately, without SSE2, the 49th and 50th coefficients. Something like this: - -\code - for(int i = 0; i < 4*(size/4); i+=4) u.packet(i) = v.packet(i) + w.packet(i); - for(int i = 4*(size/4); i < size; i++) u[i] = v[i] + w[i]; -\endcode - -So let us look line by line at our example program, and let's follow Eigen as it compiles it. - -\section ConstructingVectors Constructing vectors - -Let's analyze the first line: - -\code - Eigen::VectorXf u(size), v(size), w(size); -\endcode - -First of all, VectorXf is the following typedef: -\code - typedef Matrix VectorXf; -\endcode - -The class template Matrix is declared in src/Core/util/ForwardDeclarations.h with 6 template parameters, but the last 3 are automatically determined by the first 3. So you don't need to worry about them for now. Here, Matrix\ means a matrix of floats, with a dynamic number of rows and 1 column. - -The Matrix class inherits a base class, MatrixBase. Don't worry about it, for now it suffices to say that MatrixBase is what unifies matrices/vectors and all the expressions types -- more on that below. - -When we do -\code - Eigen::VectorXf u(size); -\endcode -the constructor that is called is Matrix::Matrix(int), in src/Core/Matrix.h. Besides some assertions, all it does is to construct the \a m_storage member, which is of type DenseStorage\. - -You may wonder, isn't it overengineering to have the storage in a separate class? The reason is that the Matrix class template covers all kinds of matrices and vector: both fixed-size and dynamic-size. The storage method is not the same in these two cases. For fixed-size, the matrix coefficients are stored as a plain member array. For dynamic-size, the coefficients will be stored as a pointer to a dynamically-allocated array. Because of this, we need to abstract storage away from the Matrix class. That's DenseStorage. - -Let's look at this constructor, in src/Core/DenseStorage.h. You can see that there are many partial template specializations of DenseStorages here, treating separately the cases where dimensions are Dynamic or fixed at compile-time. The partial specialization that we are looking at is: -\code -template class DenseStorage -\endcode - -Here, the constructor called is DenseStorage::DenseStorage(int size, int rows, int columns) -with size=50, rows=50, columns=1. - -Here is this constructor: -\code -inline DenseStorage(int size, int rows, int) : m_data(internal::aligned_new(size)), m_rows(rows) {} -\endcode - -Here, the \a m_data member is the actual array of coefficients of the matrix. As you see, it is dynamically allocated. Rather than calling new[] or malloc(), as you can see, we have our own internal::aligned_new defined in src/Core/util/Memory.h. What it does is that if vectorization is enabled, then it uses a platform-specific call to allocate a 128-bit-aligned array, as that is very useful for vectorization with both SSE2 and AltiVec. If vectorization is disabled, it amounts to the standard new[]. - -As you can see, the constructor also sets the \a m_rows member to \a size. Notice that there is no \a m_columns member: indeed, in this partial specialization of DenseStorage, we know the number of columns at compile-time, since the _Cols template parameter is different from Dynamic. Namely, in our case, _Cols is 1, which is to say that our vector is just a matrix with 1 column. Hence, there is no need to store the number of columns as a runtime variable. - -When you call VectorXf::data() to get the pointer to the array of coefficients, it returns DenseStorage::data() which returns the \a m_data member. - -When you call VectorXf::size() to get the size of the vector, this is actually a method in the base class MatrixBase. It determines that the vector is a column-vector, since ColsAtCompileTime==1 (this comes from the template parameters in the typedef VectorXf). It deduces that the size is the number of rows, so it returns VectorXf::rows(), which returns DenseStorage::rows(), which returns the \a m_rows member, which was set to \a size by the constructor. - -\section ConstructionOfSumXpr Construction of the sum expression - -Now that our vectors are constructed, let's move on to the next line: - -\code -u = v + w; -\endcode - -The executive summary is that operator+ returns a "sum of vectors" expression, but doesn't actually perform the computation. It is the operator=, whose call occurs thereafter, that does the computation. - -Let us now see what Eigen does when it sees this: - -\code -v + w -\endcode - -Here, v and w are of type VectorXf, which is a typedef for a specialization of Matrix (as we explained above), which is a subclass of MatrixBase. So what is being called is - -\code -MatrixBase::operator+(const MatrixBase&) -\endcode - -The return type of this operator is -\code -CwiseBinaryOp, VectorXf, VectorXf> -\endcode -The CwiseBinaryOp class is our first encounter with an expression template. As we said, the operator+ doesn't by itself perform any computation, it just returns an abstract "sum of vectors" expression. Since there are also "difference of vectors" and "coefficient-wise product of vectors" expressions, we unify them all as "coefficient-wise binary operations", which we abbreviate as "CwiseBinaryOp". "Coefficient-wise" means that the operations is performed coefficient by coefficient. "binary" means that there are two operands -- we are adding two vectors with one another. - -Now you might ask, what if we did something like - -\code -v + w + u; -\endcode - -The first v + w would return a CwiseBinaryOp as above, so in order for this to compile, we'd need to define an operator+ also in the class CwiseBinaryOp... at this point it starts looking like a nightmare: are we going to have to define all operators in each of the expression classes (as you guessed, CwiseBinaryOp is only one of many) ? This looks like a dead end! - -The solution is that CwiseBinaryOp itself, as well as Matrix and all the other expression types, is a subclass of MatrixBase. So it is enough to define once and for all the operators in class MatrixBase. - -Since MatrixBase is the common base class of different subclasses, the aspects that depend on the subclass must be abstracted from MatrixBase. This is called polymorphism. - -The classical approach to polymorphism in C++ is by means of virtual functions. This is dynamic polymorphism. Here we don't want dynamic polymorphism because the whole design of Eigen is based around the assumption that all the complexity, all the abstraction, gets resolved at compile-time. This is crucial: if the abstraction can't get resolved at compile-time, Eigen's compile-time optimization mechanisms become useless, not to mention that if that abstraction has to be resolved at runtime it'll incur an overhead by itself. - -Here, what we want is to have a single class MatrixBase as the base of many subclasses, in such a way that each MatrixBase object (be it a matrix, or vector, or any kind of expression) knows at compile-time (as opposed to run-time) of which particular subclass it is an object (i.e. whether it is a matrix, or an expression, and what kind of expression). - -The solution is the Curiously Recurring Template Pattern. Let's do the break now. Hopefully you can read this wikipedia page during the break if needed, but it won't be allowed during the exam. - -In short, MatrixBase takes a template parameter \a Derived. Whenever we define a subclass Subclass, we actually make Subclass inherit MatrixBase\. The point is that different subclasses inherit different MatrixBase types. Thanks to this, whenever we have an object of a subclass, and we call on it some MatrixBase method, we still remember even from inside the MatrixBase method which particular subclass we're talking about. - -This means that we can put almost all the methods and operators in the base class MatrixBase, and have only the bare minimum in the subclasses. If you look at the subclasses in Eigen, like for instance the CwiseBinaryOp class, they have very few methods. There are coeff() and sometimes coeffRef() methods for access to the coefficients, there are rows() and cols() methods returning the number of rows and columns, but there isn't much more than that. All the meat is in MatrixBase, so it only needs to be coded once for all kinds of expressions, matrices, and vectors. - -So let's end this digression and come back to the piece of code from our example program that we were currently analyzing, - -\code -v + w -\endcode - -Now that MatrixBase is a good friend, let's write fully the prototype of the operator+ that gets called here (this code is from src/Core/MatrixBase.h): - -\code -template -class MatrixBase -{ - // ... - - template - const CwiseBinaryOp::Scalar>, Derived, OtherDerived> - operator+(const MatrixBase &other) const; - - // ... -}; -\endcode - -Here of course, \a Derived and \a OtherDerived are VectorXf. - -As we said, CwiseBinaryOp is also used for other operations such as substration, so it takes another template parameter determining the operation that will be applied to coefficients. This template parameter is a functor, that is, a class in which we have an operator() so it behaves like a function. Here, the functor used is internal::scalar_sum_op. It is defined in src/Core/Functors.h. - -Let us now explain the internal::traits here. The internal::scalar_sum_op class takes one template parameter: the type of the numbers to handle. Here of course we want to pass the scalar type (a.k.a. numeric type) of VectorXf, which is \c float. How do we determine which is the scalar type of \a Derived ? Throughout Eigen, all matrix and expression types define a typedef \a Scalar which gives its scalar type. For example, VectorXf::Scalar is a typedef for \c float. So here, if life was easy, we could find the numeric type of \a Derived as just -\code -typename Derived::Scalar -\endcode -Unfortunately, we can't do that here, as the compiler would complain that the type Derived hasn't yet been defined. So we use a workaround: in src/Core/util/ForwardDeclarations.h, we declared (not defined!) all our subclasses, like Matrix, and we also declared the following class template: -\code -template struct internal::traits; -\endcode -In src/Core/Matrix.h, right \em before the definition of class Matrix, we define a partial specialization of internal::traits for T=Matrix\. In this specialization of internal::traits, we define the Scalar typedef. So when we actually define Matrix, it is legal to refer to "typename internal::traits\::Scalar". - -Anyway, we have declared our operator+. In our case, where \a Derived and \a OtherDerived are VectorXf, the above declaration amounts to: -\code -class MatrixBase -{ - // ... - - const CwiseBinaryOp, VectorXf, VectorXf> - operator+(const MatrixBase &other) const; - - // ... -}; -\endcode - -Let's now jump to src/Core/CwiseBinaryOp.h to see how it is defined. As you can see there, all it does is to return a CwiseBinaryOp object, and this object is just storing references to the left-hand-side and right-hand-side expressions -- here, these are the vectors \a v and \a w. Well, the CwiseBinaryOp object is also storing an instance of the (empty) functor class, but you shouldn't worry about it as that is a minor implementation detail. - -Thus, the operator+ hasn't performed any actual computation. To summarize, the operation \a v + \a w just returned an object of type CwiseBinaryOp which did nothing else than just storing references to \a v and \a w. - -\section Assignment The assignment - -At this point, the expression \a v + \a w has finished evaluating, so, in the process of compiling the line of code -\code -u = v + w; -\endcode -we now enter the operator=. - -What operator= is being called here? The vector u is an object of class VectorXf, i.e. Matrix. In src/Core/Matrix.h, inside the definition of class Matrix, we see this: -\code - template - inline Matrix& operator=(const MatrixBase& other) - { - eigen_assert(m_storage.data()!=0 && "you cannot use operator= with a non initialized matrix (instead use set()"); - return Base::operator=(other.derived()); - } -\endcode -Here, Base is a typedef for MatrixBase\. So, what is being called is the operator= of MatrixBase. Let's see its prototype in src/Core/MatrixBase.h: -\code - template - Derived& operator=(const MatrixBase& other); -\endcode -Here, \a Derived is VectorXf (since u is a VectorXf) and \a OtherDerived is CwiseBinaryOp. More specifically, as explained in the previous section, \a OtherDerived is: -\code -CwiseBinaryOp, VectorXf, VectorXf> -\endcode -So the full prototype of the operator= being called is: -\code -VectorXf& MatrixBase::operator=(const MatrixBase, VectorXf, VectorXf> > & other); -\endcode -This operator= literally reads "copying a sum of two VectorXf's into another VectorXf". - -Let's now look at the implementation of this operator=. It resides in the file src/Core/Assign.h. - -What we can see there is: -\code -template -template -inline Derived& MatrixBase - ::operator=(const MatrixBase& other) -{ - return internal::assign_selector::run(derived(), other.derived()); -} -\endcode - -OK so our next task is to understand internal::assign_selector :) - -Here is its declaration (all that is still in the same file src/Core/Assign.h) -\code -template -struct internal::assign_selector; -\endcode - -So internal::assign_selector takes 4 template parameters, but the 2 last ones are automatically determined by the 2 first ones. - -EvalBeforeAssigning is here to enforce the EvalBeforeAssigningBit. As explained here, certain expressions have this flag which makes them automatically evaluate into temporaries before assigning them to another expression. This is the case of the Product expression, in order to avoid strange aliasing effects when doing "m = m * m;" However, of course here our CwiseBinaryOp expression doesn't have the EvalBeforeAssigningBit: we said since the beginning that we didn't want a temporary to be introduced here. So if you go to src/Core/CwiseBinaryOp.h, you'll see that the Flags in internal::traits\ don't include the EvalBeforeAssigningBit. The Flags member of CwiseBinaryOp is then imported from the internal::traits by the EIGEN_GENERIC_PUBLIC_INTERFACE macro. Anyway, here the template parameter EvalBeforeAssigning has the value \c false. - -NeedToTranspose is here for the case where the user wants to copy a row-vector into a column-vector. We allow this as a special exception to the general rule that in assignments we require the dimesions to match. Anyway, here both the left-hand and right-hand sides are column vectors, in the sense that ColsAtCompileTime is equal to 1. So NeedToTranspose is \c false too. - -So, here we are in the partial specialization: -\code -internal::assign_selector -\endcode - -Here's how it is defined: -\code -template -struct internal::assign_selector { - static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.derived()); } -}; -\endcode - -OK so now our next job is to understand how lazyAssign works :) - -\code -template -template -inline Derived& MatrixBase - ::lazyAssign(const MatrixBase& other) -{ - EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived) - eigen_assert(rows() == other.rows() && cols() == other.cols()); - internal::assign_impl::run(derived(),other.derived()); - return derived(); -} -\endcode - -What do we see here? Some assertions, and then the only interesting line is: -\code - internal::assign_impl::run(derived(),other.derived()); -\endcode - -OK so now we want to know what is inside internal::assign_impl. - -Here is its declaration: -\code -template::Vectorization, - int Unrolling = internal::assign_traits::Unrolling> -struct internal::assign_impl; -\endcode -Again, internal::assign_selector takes 4 template parameters, but the 2 last ones are automatically determined by the 2 first ones. - -These two parameters \a Vectorization and \a Unrolling are determined by a helper class internal::assign_traits. Its job is to determine which vectorization strategy to use (that is \a Vectorization) and which unrolling strategy to use (that is \a Unrolling). - -We'll not enter into the details of how these strategies are chosen (this is in the implementation of internal::assign_traits at the top of the same file). Let's just say that here \a Vectorization has the value \a LinearVectorization, and \a Unrolling has the value \a NoUnrolling (the latter is obvious since our vectors have dynamic size so there's no way to unroll the loop at compile-time). - -So the partial specialization of internal::assign_impl that we're looking at is: -\code -internal::assign_impl -\endcode - -Here is how it's defined: -\code -template -struct internal::assign_impl -{ - static void run(Derived1 &dst, const Derived2 &src) - { - const int size = dst.size(); - const int packetSize = internal::packet_traits::size; - const int alignedStart = internal::assign_traits::DstIsAligned ? 0 - : internal::first_aligned(&dst.coeffRef(0), size); - const int alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize; - - for(int index = 0; index < alignedStart; index++) - dst.copyCoeff(index, src); - - for(int index = alignedStart; index < alignedEnd; index += packetSize) - { - dst.template copyPacket::SrcAlignment>(index, src); - } - - for(int index = alignedEnd; index < size; index++) - dst.copyCoeff(index, src); - } -}; -\endcode - -Here's how it works. \a LinearVectorization means that the left-hand and right-hand side expression can be accessed linearly i.e. you can refer to their coefficients by one integer \a index, as opposed to having to refer to its coefficients by two integers \a row, \a column. - -As we said at the beginning, vectorization works with blocks of 4 floats. Here, \a PacketSize is 4. - -There are two potential problems that we need to deal with: -\li first, vectorization works much better if the packets are 128-bit-aligned. This is especially important for write access. So when writing to the coefficients of \a dst, we want to group these coefficients by packets of 4 such that each of these packets is 128-bit-aligned. In general, this requires to skip a few coefficients at the beginning of \a dst. This is the purpose of \a alignedStart. We then copy these first few coefficients one by one, not by packets. However, in our case, the \a dst expression is a VectorXf and remember that in the construction of the vectors we allocated aligned arrays. Thanks to \a DstIsAligned, Eigen remembers that without having to do any runtime check, so \a alignedStart is zero and this part is avoided altogether. -\li second, the number of coefficients to copy is not in general a multiple of \a packetSize. Here, there are 50 coefficients to copy and \a packetSize is 4. So we'll have to copy the last 2 coefficients one by one, not by packets. Here, \a alignedEnd is 48. - -Now come the actual loops. - -First, the vectorized part: the 48 first coefficients out of 50 will be copied by packets of 4: -\code - for(int index = alignedStart; index < alignedEnd; index += packetSize) - { - dst.template copyPacket::SrcAlignment>(index, src); - } -\endcode - -What is copyPacket? It is defined in src/Core/Coeffs.h: -\code -template -template -inline void MatrixBase::copyPacket(int index, const MatrixBase& other) -{ - eigen_internal_assert(index >= 0 && index < size()); - derived().template writePacket(index, - other.derived().template packet(index)); -} -\endcode - -OK, what are writePacket() and packet() here? - -First, writePacket() here is a method on the left-hand side VectorXf. So we go to src/Core/Matrix.h to look at its definition: -\code -template -inline void writePacket(int index, const PacketScalar& x) -{ - internal::pstoret(m_storage.data() + index, x); -} -\endcode -Here, \a StoreMode is \a #Aligned, indicating that we are doing a 128-bit-aligned write access, \a PacketScalar is a type representing a "SSE packet of 4 floats" and internal::pstoret is a function writing such a packet in memory. Their definitions are architecture-specific, we find them in src/Core/arch/SSE/PacketMath.h: - -The line in src/Core/arch/SSE/PacketMath.h that determines the PacketScalar type (via a typedef in Matrix.h) is: -\code -template<> struct internal::packet_traits { typedef __m128 type; enum {size=4}; }; -\endcode -Here, __m128 is a SSE-specific type. Notice that the enum \a size here is what was used to define \a packetSize above. - -And here is the implementation of internal::pstoret: -\code -template<> inline void internal::pstore(float* to, const __m128& from) { _mm_store_ps(to, from); } -\endcode -Here, __mm_store_ps is a SSE-specific intrinsic function, representing a single SSE instruction. The difference between internal::pstore and internal::pstoret is that internal::pstoret is a dispatcher handling both the aligned and unaligned cases, you find its definition in src/Core/GenericPacketMath.h: -\code -template -inline void internal::pstoret(Scalar* to, const Packet& from) -{ - if(LoadMode == Aligned) - internal::pstore(to, from); - else - internal::pstoreu(to, from); -} -\endcode - -OK, that explains how writePacket() works. Now let's look into the packet() call. Remember that we are analyzing this line of code inside copyPacket(): -\code -derived().template writePacket(index, - other.derived().template packet(index)); -\endcode - -Here, \a other is our sum expression \a v + \a w. The .derived() is just casting from MatrixBase to the subclass which here is CwiseBinaryOp. So let's go to src/Core/CwiseBinaryOp.h: -\code -class CwiseBinaryOp -{ - // ... - template - inline PacketScalar packet(int index) const - { - return m_functor.packetOp(m_lhs.template packet(index), m_rhs.template packet(index)); - } -}; -\endcode -Here, \a m_lhs is the vector \a v, and \a m_rhs is the vector \a w. So the packet() function here is Matrix::packet(). The template parameter \a LoadMode is \a #Aligned. So we're looking at -\code -class Matrix -{ - // ... - template - inline PacketScalar packet(int index) const - { - return internal::ploadt(m_storage.data() + index); - } -}; -\endcode -We let you look up the definition of internal::ploadt in GenericPacketMath.h and the internal::pload in src/Core/arch/SSE/PacketMath.h. It is very similar to the above for internal::pstore. - -Let's go back to CwiseBinaryOp::packet(). Once the packets from the vectors \a v and \a w have been returned, what does this function do? It calls m_functor.packetOp() on them. What is m_functor? Here we must remember what particular template specialization of CwiseBinaryOp we're dealing with: -\code -CwiseBinaryOp, VectorXf, VectorXf> -\endcode -So m_functor is an object of the empty class internal::scalar_sum_op. As we mentioned above, don't worry about why we constructed an object of this empty class at all -- it's an implementation detail, the point is that some other functors need to store member data. - -Anyway, internal::scalar_sum_op is defined in src/Core/Functors.h: -\code -template struct internal::scalar_sum_op EIGEN_EMPTY_STRUCT { - inline const Scalar operator() (const Scalar& a, const Scalar& b) const { return a + b; } - template - inline const PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const - { return internal::padd(a,b); } -}; -\endcode -As you can see, all what packetOp() does is to call internal::padd on the two packets. Here is the definition of internal::padd from src/Core/arch/SSE/PacketMath.h: -\code -template<> inline __m128 internal::padd(const __m128& a, const __m128& b) { return _mm_add_ps(a,b); } -\endcode -Here, _mm_add_ps is a SSE-specific intrinsic function, representing a single SSE instruction. - -To summarize, the loop -\code - for(int index = alignedStart; index < alignedEnd; index += packetSize) - { - dst.template copyPacket::SrcAlignment>(index, src); - } -\endcode -has been compiled to the following code: for \a index going from 0 to the 11 ( = 48/4 - 1), read the i-th packet (of 4 floats) from the vector v and the i-th packet from the vector w using two __mm_load_ps SSE instructions, then add them together using a __mm_add_ps instruction, then store the result using a __mm_store_ps instruction. - -There remains the second loop handling the last few (here, the last 2) coefficients: -\code - for(int index = alignedEnd; index < size; index++) - dst.copyCoeff(index, src); -\endcode -However, it works just like the one we just explained, it is just simpler because there is no SSE vectorization involved here. copyPacket() becomes copyCoeff(), packet() becomes coeff(), writePacket() becomes coeffRef(). If you followed us this far, you can probably understand this part by yourself. - -We see that all the C++ abstraction of Eigen goes away during compilation and that we indeed are precisely controlling which assembly instructions we emit. Such is the beauty of C++! Since we have such precise control over the emitted assembly instructions, but such complex logic to choose the right instructions, we can say that Eigen really behaves like an optimizing compiler. If you prefer, you could say that Eigen behaves like a script for the compiler. In a sense, C++ template metaprogramming is scripting the compiler -- and it's been shown that this scripting language is Turing-complete. See Wikipedia. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/Manual.dox b/testbed/nanogui/ext/eigen/doc/Manual.dox deleted file mode 100644 index 3367982c..00000000 --- a/testbed/nanogui/ext/eigen/doc/Manual.dox +++ /dev/null @@ -1,159 +0,0 @@ - -// This file strutures pages and modules into a convenient hierarchical structure. - -namespace Eigen { - -/** \page UserManual_Generalities General topics - - \subpage Eigen2ToEigen3 - - \subpage TopicFunctionTakingEigenTypes - - \subpage TopicPreprocessorDirectives - - \subpage TopicAssertions - - \subpage TopicCustomizingEigen - - \subpage TopicMultiThreading - - \subpage TopicUsingIntelMKL - - \subpage TopicTemplateKeyword - - \subpage UserManual_UnderstandingEigen -*/ - -/** \page UserManual_UnderstandingEigen Understanding Eigen - - \subpage TopicInsideEigenExample - - \subpage TopicClassHierarchy - - \subpage TopicLazyEvaluation -*/ - -/** \page UnclassifiedPages Unclassified pages - - \subpage TopicResizing - - \subpage TopicVectorization - - \subpage TopicEigenExpressionTemplates - - \subpage TopicScalarTypes - - \subpage GettingStarted - - \subpage TutorialSparse_example_details - - \subpage TopicWritingEfficientProductExpression - - \subpage Experimental -*/ - - -/** \defgroup Support_modules Support modules - * Category of modules which add support for external libraries. - */ - - -/** \defgroup DenseMatrixManipulation_chapter Dense matrix and array manipulation */ -/** \defgroup DenseMatrixManipulation_Alignement Alignment issues */ -/** \defgroup DenseMatrixManipulation_Reference Reference */ - -/** \addtogroup TutorialMatrixClass - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TutorialMatrixArithmetic - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TutorialArrayClass - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TutorialBlockOperations - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TutorialAdvancedInitialization - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TutorialReductionsVisitorsBroadcasting - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TutorialMapClass - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TopicAliasing - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TopicStorageOrders - \ingroup DenseMatrixManipulation_chapter */ - -/** \addtogroup DenseMatrixManipulation_Alignement - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup TopicUnalignedArrayAssert - \ingroup DenseMatrixManipulation_Alignement */ -/** \addtogroup TopicFixedSizeVectorizable - \ingroup DenseMatrixManipulation_Alignement */ -/** \addtogroup TopicStructHavingEigenMembers - \ingroup DenseMatrixManipulation_Alignement */ -/** \addtogroup TopicStlContainers - \ingroup DenseMatrixManipulation_Alignement */ -/** \addtogroup TopicPassingByValue - \ingroup DenseMatrixManipulation_Alignement */ -/** \addtogroup TopicWrongStackAlignment - \ingroup DenseMatrixManipulation_Alignement */ - -/** \addtogroup DenseMatrixManipulation_Reference - \ingroup DenseMatrixManipulation_chapter */ -/** \addtogroup Core_Module - \ingroup DenseMatrixManipulation_Reference */ -/** \addtogroup Jacobi_Module - \ingroup DenseMatrixManipulation_Reference */ -/** \addtogroup Householder_Module - \ingroup DenseMatrixManipulation_Reference */ - -/** \addtogroup QuickRefPage - \ingroup DenseMatrixManipulation_chapter */ - - -/** \defgroup DenseLinearSolvers_chapter Dense linear problems and decompositions */ -/** \defgroup DenseLinearSolvers_Reference Reference */ - -/** \addtogroup TutorialLinearAlgebra - \ingroup DenseLinearSolvers_chapter */ -/** \addtogroup TopicLinearAlgebraDecompositions - \ingroup DenseLinearSolvers_chapter */ - -/** \addtogroup DenseLinearSolvers_Reference - \ingroup DenseLinearSolvers_chapter */ -/** \addtogroup Cholesky_Module - \ingroup DenseLinearSolvers_Reference */ -/** \addtogroup LU_Module - \ingroup DenseLinearSolvers_Reference */ -/** \addtogroup QR_Module - \ingroup DenseLinearSolvers_Reference */ -/** \addtogroup SVD_Module - \ingroup DenseLinearSolvers_Reference*/ -/** \addtogroup Eigenvalues_Module - \ingroup DenseLinearSolvers_Reference */ - - - - -/** \defgroup Sparse_chapter Sparse linear algebra */ -/** \defgroup Sparse_Reference Reference */ - -/** \addtogroup TutorialSparse - \ingroup Sparse_chapter */ -/** \addtogroup TopicSparseSystems - \ingroup Sparse_chapter */ - -/** \addtogroup Sparse_Reference - \ingroup Sparse_chapter */ -/** \addtogroup SparseCore_Module - \ingroup Sparse_Reference */ -/** \addtogroup OrderingMethods_Module - \ingroup Sparse_Reference */ -/** \addtogroup SparseCholesky_Module - \ingroup Sparse_Reference */ -/** \addtogroup SparseLU_Module - \ingroup Sparse_Reference */ -/** \addtogroup SparseQR_Module - \ingroup Sparse_Reference */ -/** \addtogroup IterativeLinearSolvers_Module - \ingroup Sparse_Reference */ -/** \addtogroup Sparse_Module - \ingroup Sparse_Reference */ -/** \addtogroup Support_modules - \ingroup Sparse_Reference */ - -/** \addtogroup SparseQuickRefPage - \ingroup Sparse_chapter */ - - -/** \defgroup Geometry_chapter Geometry */ -/** \defgroup Geometry_Reference Reference */ - -/** \addtogroup TutorialGeometry - \ingroup Geometry_chapter */ - -/** \addtogroup Geometry_Reference - \ingroup Geometry_chapter */ -/** \addtogroup Geometry_Module - \ingroup Geometry_Reference */ -/** \addtogroup Splines_Module - \ingroup Geometry_Reference */ -} diff --git a/testbed/nanogui/ext/eigen/doc/Overview.dox b/testbed/nanogui/ext/eigen/doc/Overview.dox deleted file mode 100644 index 9ab96233..00000000 --- a/testbed/nanogui/ext/eigen/doc/Overview.dox +++ /dev/null @@ -1,28 +0,0 @@ -namespace Eigen { - -/** \mainpage notitle - -This is the API documentation for Eigen3. You can download it as a tgz archive for offline reading. - -You're already an Eigen2 user? Here is a \link Eigen2ToEigen3 Eigen2 to Eigen3 guide \endlink to help porting your application. - -For a first contact with Eigen, the best place is to have a look at the \link GettingStarted getting started \endlink page that show you how to write and compile your first program with Eigen. - -Then, the \b quick \b reference \b pages give you a quite complete description of the API in a very condensed format that is specially useful to recall the syntax of a particular feature, or to have a quick look at the API. They currently cover the two following feature sets, and more will come in the future: - - \link QuickRefPage [QuickRef] Dense matrix and array manipulations \endlink - - \link SparseQuickRefPage [QuickRef] Sparse linear algebra \endlink - -You're a MatLab user? There is also a short ASCII reference with Matlab translations. - -The \b main \b documentation is organized into \em chapters covering different domains of features. -They are themselves composed of \em user \em manual pages describing the different features in a comprehensive way, and \em reference pages that gives you access to the API documentation through the related Eigen's \em modules and \em classes. - -Under the \subpage UserManual_Generalities section, you will find documentation on more general topics such as preprocessor directives, controlling assertions, multi-threading, MKL support, some Eigen's internal insights, and much more... - -Finally, do not miss the search engine, useful to quickly get to the documentation of a given class or function. - -Want more? Checkout the \em unsupported \em modules documentation. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/PassingByValue.dox b/testbed/nanogui/ext/eigen/doc/PassingByValue.dox deleted file mode 100644 index bf4d0ef4..00000000 --- a/testbed/nanogui/ext/eigen/doc/PassingByValue.dox +++ /dev/null @@ -1,40 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TopicPassingByValue Passing Eigen objects by value to functions - -Passing objects by value is almost always a very bad idea in C++, as this means useless copies, and one should pass them by reference instead. - -With Eigen, this is even more important: passing \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen objects" by value is not only inefficient, it can be illegal or make your program crash! And the reason is that these Eigen objects have alignment modifiers that aren't respected when they are passed by value. - -So for example, a function like this, where v is passed by value: - -\code -void my_function(Eigen::Vector2d v); -\endcode - -needs to be rewritten as follows, passing v by reference: - -\code -void my_function(const Eigen::Vector2d& v); -\endcode - -Likewise if you have a class having a Eigen object as member: - -\code -struct Foo -{ - Eigen::Vector2d v; -}; -void my_function(Foo v); -\endcode - -This function also needs to be rewritten like this: -\code -void my_function(const Foo& v); -\endcode - -Note that on the other hand, there is no problem with functions that return objects by value. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/PreprocessorDirectives.dox b/testbed/nanogui/ext/eigen/doc/PreprocessorDirectives.dox deleted file mode 100644 index 8a2968eb..00000000 --- a/testbed/nanogui/ext/eigen/doc/PreprocessorDirectives.dox +++ /dev/null @@ -1,119 +0,0 @@ -namespace Eigen { - -/** \page TopicPreprocessorDirectives Preprocessor directives - -You can control some aspects of %Eigen by defining the preprocessor tokens using \c \#define. These macros -should be defined before any %Eigen headers are included. Often they are best set in the project options. - -This page lists the preprocesor tokens recognised by %Eigen. - -\eigenAutoToc - - -\section TopicPreprocessorDirectivesMajor Macros with major effects - -These macros have a major effect and typically break the API (Application Programming Interface) and/or the -ABI (Application Binary Interface). This can be rather dangerous: if parts of your program are compiled with -one option, and other parts (or libraries that you use) are compiled with another option, your program may -fail to link or exhibit subtle bugs. Nevertheless, these options can be useful for people who know what they -are doing. - - - \b EIGEN2_SUPPORT - if defined, enables the Eigen2 compatibility mode. This is meant to ease the transition - of Eigen2 to Eigen3 (see \ref Eigen2ToEigen3). Not defined by default. - - \b EIGEN2_SUPPORT_STAGEnn_xxx (for various values of nn and xxx) - staged migration path from Eigen2 to - Eigen3; see \ref Eigen2SupportModes. - - \b EIGEN_DEFAULT_DENSE_INDEX_TYPE - the type for column and row indices in matrices, vectors and array - (DenseBase::Index). Set to \c std::ptrdiff_t by default. - - \b EIGEN_DEFAULT_IO_FORMAT - the IOFormat to use when printing a matrix if no %IOFormat is specified. - Defaults to the %IOFormat constructed by the default constructor IOFormat::IOFormat(). - - \b EIGEN_INITIALIZE_MATRICES_BY_ZERO - if defined, all entries of newly constructed matrices and arrays are - initialized to zero, as are new entries in matrices and arrays after resizing. Not defined by default. - - \b EIGEN_INITIALIZE_MATRICES_BY_NAN - if defined, all entries of newly constructed matrices and arrays are - initialized to NaN, as are new entries in matrices and arrays after resizing. This option is especially - useful for debugging purpose, though a memory tool like valgrind is - preferable. Not defined by default. - - \b EIGEN_NO_AUTOMATIC_RESIZING - if defined, the matrices (or arrays) on both sides of an assignment - a = b have to be of the same size; otherwise, %Eigen automatically resizes \c a so that it is of - the correct size. Not defined by default. - - -\section TopicPreprocessorDirectivesAssertions Assertions - -The %Eigen library contains many assertions to guard against programming errors, both at compile time and at -run time. However, these assertions do cost time and can thus be turned off. - - - \b EIGEN_NO_DEBUG - disables %Eigen's assertions if defined. Not defined by default, unless the - \c NDEBUG macro is defined (this is a standard C++ macro which disables all asserts). - - \b EIGEN_NO_STATIC_ASSERT - if defined, compile-time static assertions are replaced by runtime assertions; - this saves compilation time. Not defined by default. - - \b eigen_assert - macro with one argument that is used inside %Eigen for assertions. By default, it is - basically defined to be \c assert, which aborts the program if the assertion is violated. Redefine this - macro if you want to do something else, like throwing an exception. - - \b EIGEN_MPL2_ONLY - disable non MPL2 compatible features, or in other words disable the features which - are still under the LGPL. - - -\section TopicPreprocessorDirectivesPerformance Alignment, vectorization and performance tweaking - - - \b EIGEN_MALLOC_ALREADY_ALIGNED - Can be set to 0 or 1 to tell whether default system malloc already - returns aligned buffers. In not defined, then this information is automatically deduced from the compiler - and system preprocessor tokens. - - \b EIGEN_DONT_ALIGN - disables alignment completely. %Eigen will not try to align its objects and does not - expect that any objects passed to it are aligned. This will turn off vectorization. Not defined by default. - - \b EIGEN_DONT_ALIGN_STATICALLY - disables alignment of arrays on the stack. Not defined by default, unless - \c EIGEN_DONT_ALIGN is defined. - - \b EIGEN_DONT_PARALLELIZE - if defined, this disables multi-threading. This is only relevant if you enabled OpenMP. - See \ref TopicMultiThreading for details. - - \b EIGEN_DONT_VECTORIZE - disables explicit vectorization when defined. Not defined by default, unless - alignment is disabled by %Eigen's platform test or the user defining \c EIGEN_DONT_ALIGN. - - \b EIGEN_FAST_MATH - enables some optimizations which might affect the accuracy of the result. This currently - enables the SSE vectorization of sin() and cos(), and speedups sqrt() for single precision. Defined to 1 by default. - Define it to 0 to disable. - - \b EIGEN_UNROLLING_LIMIT - defines the size of a loop to enable meta unrolling. Set it to zero to disable - unrolling. The size of a loop here is expressed in %Eigen's own notion of "number of FLOPS", it does not - correspond to the number of iterations or the number of instructions. The default is value 100. - - \b EIGEN_STACK_ALLOCATION_LIMIT - defines the maximum bytes for a buffer to be allocated on the stack. For internal - temporary buffers, dynamic memory allocation is employed as a fall back. For fixed-size matrices or arrays, exceeding - this threshold raises a compile time assertion. Use 0 to set no limit. Default is 128 KB. - - -\section TopicPreprocessorDirectivesPlugins Plugins - -It is possible to add new methods to many fundamental classes in %Eigen by writing a plugin. As explained in -the section \ref ExtendingMatrixBase, the plugin is specified by defining a \c EIGEN_xxx_PLUGIN macro. The -following macros are supported; none of them are defined by default. - - - \b EIGEN_ARRAY_PLUGIN - filename of plugin for extending the Array class. - - \b EIGEN_ARRAYBASE_PLUGIN - filename of plugin for extending the ArrayBase class. - - \b EIGEN_CWISE_PLUGIN - filename of plugin for extending the Cwise class. - - \b EIGEN_DENSEBASE_PLUGIN - filename of plugin for extending the DenseBase class. - - \b EIGEN_DYNAMICSPARSEMATRIX_PLUGIN - filename of plugin for extending the DynamicSparseMatrix class. - - \b EIGEN_MATRIX_PLUGIN - filename of plugin for extending the Matrix class. - - \b EIGEN_MATRIXBASE_PLUGIN - filename of plugin for extending the MatrixBase class. - - \b EIGEN_PLAINOBJECTBASE_PLUGIN - filename of plugin for extending the PlainObjectBase class. - - \b EIGEN_QUATERNIONBASE_PLUGIN - filename of plugin for extending the QuaternionBase class. - - \b EIGEN_SPARSEMATRIX_PLUGIN - filename of plugin for extending the SparseMatrix class. - - \b EIGEN_SPARSEMATRIXBASE_PLUGIN - filename of plugin for extending the SparseMatrixBase class. - - \b EIGEN_SPARSEVECTOR_PLUGIN - filename of plugin for extending the SparseVector class. - - \b EIGEN_TRANSFORM_PLUGIN - filename of plugin for extending the Transform class. - - \b EIGEN_FUNCTORS_PLUGIN - filename of plugin for adding new functors and specializations of functor_traits. - - -\section TopicPreprocessorDirectivesDevelopers Macros for Eigen developers - -These macros are mainly meant for people developing %Eigen and for testing purposes. Even though, they might be useful for power users and the curious for debugging and testing purpose, they \b should \b not \b be \b used by real-word code. - - - \b EIGEN_DEFAULT_TO_ROW_MAJOR - when defined, the default storage order for matrices becomes row-major - instead of column-major. Not defined by default. - - \b EIGEN_INTERNAL_DEBUGGING - if defined, enables assertions in %Eigen's internal routines. This is useful - for debugging %Eigen itself. Not defined by default. - - \b EIGEN_NO_MALLOC - if defined, any request from inside the %Eigen to allocate memory from the heap - results in an assertion failure. This is useful to check that some routine does not allocate memory - dynamically. Not defined by default. - - \b EIGEN_RUNTIME_NO_MALLOC - if defined, a new switch is introduced which can be turned on and off by - calling set_is_malloc_allowed(bool). If malloc is not allowed and %Eigen tries to allocate memory - dynamically anyway, an assertion failure results. Not defined by default. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/QuickReference.dox b/testbed/nanogui/ext/eigen/doc/QuickReference.dox deleted file mode 100644 index a4be0f68..00000000 --- a/testbed/nanogui/ext/eigen/doc/QuickReference.dox +++ /dev/null @@ -1,727 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage QuickRefPage Quick reference guide - -\eigenAutoToc - -
- -top -\section QuickRef_Headers Modules and Header files - -The Eigen library is divided in a Core module and several additional modules. Each module has a corresponding header file which has to be included in order to use the module. The \c %Dense and \c Eigen header files are provided to conveniently gain access to several modules at once. - - - - - - - - - - - - - - -
ModuleHeader fileContents
\link Core_Module Core \endlink\code#include \endcodeMatrix and Array classes, basic linear algebra (including triangular and selfadjoint products), array manipulation
\link Geometry_Module Geometry \endlink\code#include \endcodeTransform, Translation, Scaling, Rotation2D and 3D rotations (Quaternion, AngleAxis)
\link LU_Module LU \endlink\code#include \endcodeInverse, determinant, LU decompositions with solver (FullPivLU, PartialPivLU)
\link Cholesky_Module Cholesky \endlink\code#include \endcodeLLT and LDLT Cholesky factorization with solver
\link Householder_Module Householder \endlink\code#include \endcodeHouseholder transformations; this module is used by several linear algebra modules
\link SVD_Module SVD \endlink\code#include \endcodeSVD decomposition with least-squares solver (JacobiSVD)
\link QR_Module QR \endlink\code#include \endcodeQR decomposition with solver (HouseholderQR, ColPivHouseholderQR, FullPivHouseholderQR)
\link Eigenvalues_Module Eigenvalues \endlink\code#include \endcodeEigenvalue, eigenvector decompositions (EigenSolver, SelfAdjointEigenSolver, ComplexEigenSolver)
\link Sparse_modules Sparse \endlink\code#include \endcode%Sparse matrix storage and related basic linear algebra (SparseMatrix, DynamicSparseMatrix, SparseVector)
\code#include \endcodeIncludes Core, Geometry, LU, Cholesky, SVD, QR, and Eigenvalues header files
\code#include \endcodeIncludes %Dense and %Sparse header files (the whole Eigen library)
- -top -\section QuickRef_Types Array, matrix and vector types - - -\b Recall: Eigen provides two kinds of dense objects: mathematical matrices and vectors which are both represented by the template class Matrix, and general 1D and 2D arrays represented by the template class Array: -\code -typedef Matrix MyMatrixType; -typedef Array MyArrayType; -\endcode - -\li \c Scalar is the scalar type of the coefficients (e.g., \c float, \c double, \c bool, \c int, etc.). -\li \c RowsAtCompileTime and \c ColsAtCompileTime are the number of rows and columns of the matrix as known at compile-time or \c Dynamic. -\li \c Options can be \c ColMajor or \c RowMajor, default is \c ColMajor. (see class Matrix for more options) - -All combinations are allowed: you can have a matrix with a fixed number of rows and a dynamic number of columns, etc. The following are all valid: -\code -Matrix // Dynamic number of columns (heap allocation) -Matrix // Dynamic number of rows (heap allocation) -Matrix // Fully dynamic, row major (heap allocation) -Matrix // Fully fixed (usually allocated on stack) -\endcode - -In most cases, you can simply use one of the convenience typedefs for \ref matrixtypedefs "matrices" and \ref arraytypedefs "arrays". Some examples: - - - -
MatricesArrays
\code -Matrix <=> MatrixXf -Matrix <=> VectorXd -Matrix <=> RowVectorXi -Matrix <=> Matrix3f -Matrix <=> Vector4f -\endcode\code -Array <=> ArrayXXf -Array <=> ArrayXd -Array <=> RowArrayXi -Array <=> Array33f -Array <=> Array4f -\endcode
- -Conversion between the matrix and array worlds: -\code -Array44f a1, a1; -Matrix4f m1, m2; -m1 = a1 * a2; // coeffwise product, implicit conversion from array to matrix. -a1 = m1 * m2; // matrix product, implicit conversion from matrix to array. -a2 = a1 + m1.array(); // mixing array and matrix is forbidden -m2 = a1.matrix() + m1; // and explicit conversion is required. -ArrayWrapper m1a(m1); // m1a is an alias for m1.array(), they share the same coefficients -MatrixWrapper a1m(a1); -\endcode - -In the rest of this document we will use the following symbols to emphasize the features which are specifics to a given kind of object: -\li \matrixworld linear algebra matrix and vector only -\li \arrayworld array objects only - -\subsection QuickRef_Basics Basic matrix manipulation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1D objects2D objectsNotes
Constructors\code -Vector4d v4; -Vector2f v1(x, y); -Array3i v2(x, y, z); -Vector4d v3(x, y, z, w); - -VectorXf v5; // empty object -ArrayXf v6(size); -\endcode\code -Matrix4f m1; - - - - -MatrixXf m5; // empty object -MatrixXf m6(nb_rows, nb_columns); -\endcode -By default, the coefficients \n are left uninitialized
Comma initializer\code -Vector3f v1; v1 << x, y, z; -ArrayXf v2(4); v2 << 1, 2, 3, 4; - -\endcode\code -Matrix3f m1; m1 << 1, 2, 3, - 4, 5, 6, - 7, 8, 9; -\endcode
Comma initializer (bis) -\include Tutorial_commainit_02.cpp - -output: -\verbinclude Tutorial_commainit_02.out -
Runtime info\code -vector.size(); - -vector.innerStride(); -vector.data(); -\endcode\code -matrix.rows(); matrix.cols(); -matrix.innerSize(); matrix.outerSize(); -matrix.innerStride(); matrix.outerStride(); -matrix.data(); -\endcodeInner/Outer* are storage order dependent
Compile-time info\code -ObjectType::Scalar ObjectType::RowsAtCompileTime -ObjectType::RealScalar ObjectType::ColsAtCompileTime -ObjectType::Index ObjectType::SizeAtCompileTime -\endcode
Resizing\code -vector.resize(size); - - -vector.resizeLike(other_vector); -vector.conservativeResize(size); -\endcode\code -matrix.resize(nb_rows, nb_cols); -matrix.resize(Eigen::NoChange, nb_cols); -matrix.resize(nb_rows, Eigen::NoChange); -matrix.resizeLike(other_matrix); -matrix.conservativeResize(nb_rows, nb_cols); -\endcodeno-op if the new sizes match,
otherwise data are lost

resizing with data preservation
Coeff access with \n range checking\code -vector(i) vector.x() -vector[i] vector.y() - vector.z() - vector.w() -\endcode\code -matrix(i,j) -\endcodeRange checking is disabled if \n NDEBUG or EIGEN_NO_DEBUG is defined
Coeff access without \n range checking\code -vector.coeff(i) -vector.coeffRef(i) -\endcode\code -matrix.coeff(i,j) -matrix.coeffRef(i,j) -\endcode
Assignment/copy\code -object = expression; -object_of_float = expression_of_double.cast(); -\endcodethe destination is automatically resized (if possible)
- -\subsection QuickRef_PredefMat Predefined Matrices - - - - - - - - - - - - - - - - - - - -
Fixed-size matrix or vectorDynamic-size matrixDynamic-size vector
-\code -typedef {Matrix3f|Array33f} FixedXD; -FixedXD x; - -x = FixedXD::Zero(); -x = FixedXD::Ones(); -x = FixedXD::Constant(value); -x = FixedXD::Random(); -x = FixedXD::LinSpaced(size, low, high); - -x.setZero(); -x.setOnes(); -x.setConstant(value); -x.setRandom(); -x.setLinSpaced(size, low, high); -\endcode - -\code -typedef {MatrixXf|ArrayXXf} Dynamic2D; -Dynamic2D x; - -x = Dynamic2D::Zero(rows, cols); -x = Dynamic2D::Ones(rows, cols); -x = Dynamic2D::Constant(rows, cols, value); -x = Dynamic2D::Random(rows, cols); -N/A - -x.setZero(rows, cols); -x.setOnes(rows, cols); -x.setConstant(rows, cols, value); -x.setRandom(rows, cols); -N/A -\endcode - -\code -typedef {VectorXf|ArrayXf} Dynamic1D; -Dynamic1D x; - -x = Dynamic1D::Zero(size); -x = Dynamic1D::Ones(size); -x = Dynamic1D::Constant(size, value); -x = Dynamic1D::Random(size); -x = Dynamic1D::LinSpaced(size, low, high); - -x.setZero(size); -x.setOnes(size); -x.setConstant(size, value); -x.setRandom(size); -x.setLinSpaced(size, low, high); -\endcode -
Identity and \link MatrixBase::Unit basis vectors \endlink \matrixworld
-\code -x = FixedXD::Identity(); -x.setIdentity(); - -Vector3f::UnitX() // 1 0 0 -Vector3f::UnitY() // 0 1 0 -Vector3f::UnitZ() // 0 0 1 -\endcode - -\code -x = Dynamic2D::Identity(rows, cols); -x.setIdentity(rows, cols); - - - -N/A -\endcode - \code -N/A - - -VectorXf::Unit(size,i) -VectorXf::Unit(4,1) == Vector4f(0,1,0,0) - == Vector4f::UnitY() -\endcode -
- - - -\subsection QuickRef_Map Mapping external arrays - - - - - - - - - - -
Contiguous \n memory\code -float data[] = {1,2,3,4}; -Map v1(data); // uses v1 as a Vector3f object -Map v2(data,3); // uses v2 as a ArrayXf object -Map m1(data); // uses m1 as a Array22f object -Map m2(data,2,2); // uses m2 as a MatrixXf object -\endcode
Typical usage \n of strides\code -float data[] = {1,2,3,4,5,6,7,8,9}; -Map > v1(data,3); // = [1,3,5] -Map > v2(data,3,InnerStride<>(3)); // = [1,4,7] -Map > m2(data,2,3); // both lines |1,4,7| -Map > m1(data,2,3,OuterStride<>(3)); // are equal to: |2,5,8| -\endcode
- - -top -\section QuickRef_ArithmeticOperators Arithmetic Operators - - - - - - - - - - - - -
-add \n subtract\code -mat3 = mat1 + mat2; mat3 += mat1; -mat3 = mat1 - mat2; mat3 -= mat1;\endcode -
-scalar product\code -mat3 = mat1 * s1; mat3 *= s1; mat3 = s1 * mat1; -mat3 = mat1 / s1; mat3 /= s1;\endcode -
-matrix/vector \n products \matrixworld\code -col2 = mat1 * col1; -row2 = row1 * mat1; row1 *= mat1; -mat3 = mat1 * mat2; mat3 *= mat1; \endcode -
-transposition \n adjoint \matrixworld\code -mat1 = mat2.transpose(); mat1.transposeInPlace(); -mat1 = mat2.adjoint(); mat1.adjointInPlace(); -\endcode -
-\link MatrixBase::dot() dot \endlink product \n inner product \matrixworld\code -scalar = vec1.dot(vec2); -scalar = col1.adjoint() * col2; -scalar = (col1.adjoint() * col2).value();\endcode -
-outer product \matrixworld\code -mat = col1 * col2.transpose();\endcode -
-\link MatrixBase::norm() norm \endlink \n \link MatrixBase::normalized() normalization \endlink \matrixworld\code -scalar = vec1.norm(); scalar = vec1.squaredNorm() -vec2 = vec1.normalized(); vec1.normalize(); // inplace \endcode -
-\link MatrixBase::cross() cross product \endlink \matrixworld\code -#include -vec3 = vec1.cross(vec2);\endcode
- -top -\section QuickRef_Coeffwise Coefficient-wise \& Array operators -Coefficient-wise operators for matrices and vectors: - - - -
Matrix API \matrixworldVia Array conversions
\code -mat1.cwiseMin(mat2) -mat1.cwiseMax(mat2) -mat1.cwiseAbs2() -mat1.cwiseAbs() -mat1.cwiseSqrt() -mat1.cwiseProduct(mat2) -mat1.cwiseQuotient(mat2)\endcode -\code -mat1.array().min(mat2.array()) -mat1.array().max(mat2.array()) -mat1.array().abs2() -mat1.array().abs() -mat1.array().sqrt() -mat1.array() * mat2.array() -mat1.array() / mat2.array() -\endcode
- -It is also very simple to apply any user defined function \c foo using DenseBase::unaryExpr together with std::ptr_fun: -\code mat1.unaryExpr(std::ptr_fun(foo))\endcode - -Array operators:\arrayworld - - - - - -
Arithmetic operators\code -array1 * array2 array1 / array2 array1 *= array2 array1 /= array2 -array1 + scalar array1 - scalar array1 += scalar array1 -= scalar -\endcode
Comparisons\code -array1 < array2 array1 > array2 array1 < scalar array1 > scalar -array1 <= array2 array1 >= array2 array1 <= scalar array1 >= scalar -array1 == array2 array1 != array2 array1 == scalar array1 != scalar -\endcode
Trigo, power, and \n misc functions \n and the STL variants\code -array1.min(array2) -array1.max(array2) -array1.abs2() -array1.abs() abs(array1) -array1.sqrt() sqrt(array1) -array1.log() log(array1) -array1.exp() exp(array1) -array1.pow(exponent) pow(array1,exponent) -array1.square() -array1.cube() -array1.inverse() -array1.sin() sin(array1) -array1.cos() cos(array1) -array1.tan() tan(array1) -array1.asin() asin(array1) -array1.acos() acos(array1) -\endcode -
- -top -\section QuickRef_Reductions Reductions - -Eigen provides several reduction methods such as: -\link DenseBase::minCoeff() minCoeff() \endlink, \link DenseBase::maxCoeff() maxCoeff() \endlink, -\link DenseBase::sum() sum() \endlink, \link DenseBase::prod() prod() \endlink, -\link MatrixBase::trace() trace() \endlink \matrixworld, -\link MatrixBase::norm() norm() \endlink \matrixworld, \link MatrixBase::squaredNorm() squaredNorm() \endlink \matrixworld, -\link DenseBase::all() all() \endlink, and \link DenseBase::any() any() \endlink. -All reduction operations can be done matrix-wise, -\link DenseBase::colwise() column-wise \endlink or -\link DenseBase::rowwise() row-wise \endlink. Usage example: - - - - -
\code - 5 3 1 -mat = 2 7 8 - 9 4 6 \endcode - \code mat.minCoeff(); \endcode\code 1 \endcode
\code mat.colwise().minCoeff(); \endcode\code 2 3 1 \endcode
\code mat.rowwise().minCoeff(); \endcode\code -1 -2 -4 -\endcode
- -Special versions of \link DenseBase::minCoeff(IndexType*,IndexType*) const minCoeff \endlink and \link DenseBase::maxCoeff(IndexType*,IndexType*) const maxCoeff \endlink: -\code -int i, j; -s = vector.minCoeff(&i); // s == vector[i] -s = matrix.maxCoeff(&i, &j); // s == matrix(i,j) -\endcode -Typical use cases of all() and any(): -\code -if((array1 > 0).all()) ... // if all coefficients of array1 are greater than 0 ... -if((array1 < array2).any()) ... // if there exist a pair i,j such that array1(i,j) < array2(i,j) ... -\endcode - - -top\section QuickRef_Blocks Sub-matrices - -Read-write access to a \link DenseBase::col(Index) column \endlink -or a \link DenseBase::row(Index) row \endlink of a matrix (or array): -\code -mat1.row(i) = mat2.col(j); -mat1.col(j1).swap(mat1.col(j2)); -\endcode - -Read-write access to sub-vectors: - - - - - - - - - - - - - - - - - -
Default versionsOptimized versions when the size \n is known at compile time
\code vec1.head(n)\endcode\code vec1.head()\endcodethe first \c n coeffs
\code vec1.tail(n)\endcode\code vec1.tail()\endcodethe last \c n coeffs
\code vec1.segment(pos,n)\endcode\code vec1.segment(pos)\endcodethe \c n coeffs in the \n range [\c pos : \c pos + \c n - 1]
- -Read-write access to sub-matrices:
\code mat1.block(i,j,rows,cols)\endcode - \link DenseBase::block(Index,Index,Index,Index) (more) \endlink\code mat1.block(i,j)\endcode - \link DenseBase::block(Index,Index) (more) \endlinkthe \c rows x \c cols sub-matrix \n starting from position (\c i,\c j)
\code - mat1.topLeftCorner(rows,cols) - mat1.topRightCorner(rows,cols) - mat1.bottomLeftCorner(rows,cols) - mat1.bottomRightCorner(rows,cols)\endcode - \code - mat1.topLeftCorner() - mat1.topRightCorner() - mat1.bottomLeftCorner() - mat1.bottomRightCorner()\endcode - the \c rows x \c cols sub-matrix \n taken in one of the four corners
\code - mat1.topRows(rows) - mat1.bottomRows(rows) - mat1.leftCols(cols) - mat1.rightCols(cols)\endcode - \code - mat1.topRows() - mat1.bottomRows() - mat1.leftCols() - mat1.rightCols()\endcode - specialized versions of block() \n when the block fit two corners
- - - -top\section QuickRef_Misc Miscellaneous operations - -\subsection QuickRef_Reverse Reverse -Vectors, rows, and/or columns of a matrix can be reversed (see DenseBase::reverse(), DenseBase::reverseInPlace(), VectorwiseOp::reverse()). -\code -vec.reverse() mat.colwise().reverse() mat.rowwise().reverse() -vec.reverseInPlace() -\endcode - -\subsection QuickRef_Replicate Replicate -Vectors, matrices, rows, and/or columns can be replicated in any direction (see DenseBase::replicate(), VectorwiseOp::replicate()) -\code -vec.replicate(times) vec.replicate -mat.replicate(vertical_times, horizontal_times) mat.replicate() -mat.colwise().replicate(vertical_times, horizontal_times) mat.colwise().replicate() -mat.rowwise().replicate(vertical_times, horizontal_times) mat.rowwise().replicate() -\endcode - - -top\section QuickRef_DiagTriSymm Diagonal, Triangular, and Self-adjoint matrices -(matrix world \matrixworld) - -\subsection QuickRef_Diagonal Diagonal matrices - - - - - - - - - - - - - -
OperationCode
-view a vector \link MatrixBase::asDiagonal() as a diagonal matrix \endlink \n \code -mat1 = vec1.asDiagonal();\endcode -
-Declare a diagonal matrix\code -DiagonalMatrix diag1(size); -diag1.diagonal() = vector;\endcode -
Access the \link MatrixBase::diagonal() diagonal \endlink and \link MatrixBase::diagonal(Index) super/sub diagonals \endlink of a matrix as a vector (read/write)\code -vec1 = mat1.diagonal(); mat1.diagonal() = vec1; // main diagonal -vec1 = mat1.diagonal(+n); mat1.diagonal(+n) = vec1; // n-th super diagonal -vec1 = mat1.diagonal(-n); mat1.diagonal(-n) = vec1; // n-th sub diagonal -vec1 = mat1.diagonal<1>(); mat1.diagonal<1>() = vec1; // first super diagonal -vec1 = mat1.diagonal<-2>(); mat1.diagonal<-2>() = vec1; // second sub diagonal -\endcode
Optimized products and inverse\code -mat3 = scalar * diag1 * mat1; -mat3 += scalar * mat1 * vec1.asDiagonal(); -mat3 = vec1.asDiagonal().inverse() * mat1 -mat3 = mat1 * diag1.inverse() -\endcode
- -\subsection QuickRef_TriangularView Triangular views - -TriangularView gives a view on a triangular part of a dense matrix and allows to perform optimized operations on it. The opposite triangular part is never referenced and can be used to store other information. - -\note The .triangularView() template member function requires the \c template keyword if it is used on an -object of a type that depends on a template parameter; see \ref TopicTemplateKeyword for details. - - - - - - - - -
OperationCode
-Reference to a triangular with optional \n -unit or null diagonal (read/write): -\code -m.triangularView() -\endcode \n -\c Xxx = ::Upper, ::Lower, ::StrictlyUpper, ::StrictlyLower, ::UnitUpper, ::UnitLower -
-Writing to a specific triangular part:\n (only the referenced triangular part is evaluated) -\code -m1.triangularView() = m2 + m3 \endcode -
-Conversion to a dense matrix setting the opposite triangular part to zero: -\code -m2 = m1.triangularView()\endcode -
-Products: -\code -m3 += s1 * m1.adjoint().triangularView() * m2 -m3 -= s1 * m2.conjugate() * m1.adjoint().triangularView() \endcode -
-Solving linear equations:\n -\f$ M_2 := L_1^{-1} M_2 \f$ \n -\f$ M_3 := {L_1^*}^{-1} M_3 \f$ \n -\f$ M_4 := M_4 U_1^{-1} \f$ -\n \code -L1.triangularView().solveInPlace(M2) -L1.triangularView().adjoint().solveInPlace(M3) -U1.triangularView().solveInPlace(M4)\endcode -
- -\subsection QuickRef_SelfadjointMatrix Symmetric/selfadjoint views - -Just as for triangular matrix, you can reference any triangular part of a square matrix to see it as a selfadjoint -matrix and perform special and optimized operations. Again the opposite triangular part is never referenced and can be -used to store other information. - -\note The .selfadjointView() template member function requires the \c template keyword if it is used on an -object of a type that depends on a template parameter; see \ref TopicTemplateKeyword for details. - - - - - - - - -
OperationCode
-Conversion to a dense matrix: -\code -m2 = m.selfadjointView();\endcode -
-Product with another general matrix or vector: -\code -m3 = s1 * m1.conjugate().selfadjointView() * m3; -m3 -= s1 * m3.adjoint() * m1.selfadjointView();\endcode -
-Rank 1 and rank K update: \n -\f$ upper(M_1) \mathrel{{+}{=}} s_1 M_2 M_2^* \f$ \n -\f$ lower(M_1) \mathbin{{-}{=}} M_2^* M_2 \f$ -\n \code -M1.selfadjointView().rankUpdate(M2,s1); -M1.selfadjointView().rankUpdate(M2.adjoint(),-1); \endcode -
-Rank 2 update: (\f$ M \mathrel{{+}{=}} s u v^* + s v u^* \f$) -\code -M.selfadjointView().rankUpdate(u,v,s); -\endcode -
-Solving linear equations:\n(\f$ M_2 := M_1^{-1} M_2 \f$) -\code -// via a standard Cholesky factorization -m2 = m1.selfadjointView().llt().solve(m2); -// via a Cholesky factorization with pivoting -m2 = m1.selfadjointView().ldlt().solve(m2); -\endcode -
- -*/ - -/* - - - - - - - - - - - - - -
-\link MatrixBase::asDiagonal() make a diagonal matrix \endlink \n from a vector \code -mat1 = vec1.asDiagonal();\endcode -
-Declare a diagonal matrix\code -DiagonalMatrix diag1(size); -diag1.diagonal() = vector;\endcode -
Access \link MatrixBase::diagonal() the diagonal and super/sub diagonals of a matrix \endlink as a vector (read/write)\code -vec1 = mat1.diagonal(); mat1.diagonal() = vec1; // main diagonal -vec1 = mat1.diagonal(+n); mat1.diagonal(+n) = vec1; // n-th super diagonal -vec1 = mat1.diagonal(-n); mat1.diagonal(-n) = vec1; // n-th sub diagonal -vec1 = mat1.diagonal<1>(); mat1.diagonal<1>() = vec1; // first super diagonal -vec1 = mat1.diagonal<-2>(); mat1.diagonal<-2>() = vec1; // second sub diagonal -\endcode
View on a triangular part of a matrix (read/write)\code -mat2 = mat1.triangularView(); -// Xxx = Upper, Lower, StrictlyUpper, StrictlyLower, UnitUpper, UnitLower -mat1.triangularView() = mat2 + mat3; // only the upper part is evaluated and referenced -\endcode
View a triangular part as a symmetric/self-adjoint matrix (read/write)\code -mat2 = mat1.selfadjointView(); // Xxx = Upper or Lower -mat1.selfadjointView() = mat2 + mat2.adjoint(); // evaluated and write to the upper triangular part only -\endcode
- -Optimized products: -\code -mat3 += scalar * vec1.asDiagonal() * mat1 -mat3 += scalar * mat1 * vec1.asDiagonal() -mat3.noalias() += scalar * mat1.triangularView() * mat2 -mat3.noalias() += scalar * mat2 * mat1.triangularView() -mat3.noalias() += scalar * mat1.selfadjointView() * mat2 -mat3.noalias() += scalar * mat2 * mat1.selfadjointView() -mat1.selfadjointView().rankUpdate(mat2); -mat1.selfadjointView().rankUpdate(mat2.adjoint(), scalar); -\endcode - -Inverse products: (all are optimized) -\code -mat3 = vec1.asDiagonal().inverse() * mat1 -mat3 = mat1 * diag1.inverse() -mat1.triangularView().solveInPlace(mat2) -mat1.triangularView().solveInPlace(mat2) -mat2 = mat1.selfadjointView().llt().solve(mat2) -\endcode - -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/QuickStartGuide.dox b/testbed/nanogui/ext/eigen/doc/QuickStartGuide.dox deleted file mode 100644 index ea32c3b3..00000000 --- a/testbed/nanogui/ext/eigen/doc/QuickStartGuide.dox +++ /dev/null @@ -1,100 +0,0 @@ -namespace Eigen { - -/** \page GettingStarted Getting started - -\eigenAutoToc - -This is a very short guide on how to get started with Eigen. It has a dual purpose. It serves as a minimal introduction to the Eigen library for people who want to start coding as soon as possible. You can also read this page as the first part of the Tutorial, which explains the library in more detail; in this case you will continue with \ref TutorialMatrixClass. - -\section GettingStartedInstallation How to "install" Eigen? - -In order to use Eigen, you just need to download and extract Eigen's source code (see the wiki for download instructions). In fact, the header files in the \c Eigen subdirectory are the only files required to compile programs using Eigen. The header files are the same for all platforms. It is not necessary to use CMake or install anything. - - -\section GettingStartedFirstProgram A simple first program - -Here is a rather simple program to get you started. - -\include QuickStart_example.cpp - -We will explain the program after telling you how to compile it. - - -\section GettingStartedCompiling Compiling and running your first program - -There is no library to link to. The only thing that you need to keep in mind when compiling the above program is that the compiler must be able to find the Eigen header files. The directory in which you placed Eigen's source code must be in the include path. With GCC you use the -I option to achieve this, so you can compile the program with a command like this: - -\code g++ -I /path/to/eigen/ my_program.cpp -o my_program \endcode - -On Linux or Mac OS X, another option is to symlink or copy the Eigen folder into /usr/local/include/. This way, you can compile the program with: - -\code g++ my_program.cpp -o my_program \endcode - -When you run the program, it produces the following output: - -\include QuickStart_example.out - - -\section GettingStartedExplanation Explanation of the first program - -The Eigen header files define many types, but for simple applications it may be enough to use only the \c MatrixXd type. This represents a matrix of arbitrary size (hence the \c X in \c MatrixXd), in which every entry is a \c double (hence the \c d in \c MatrixXd). See the \ref QuickRef_Types "quick reference guide" for an overview of the different types you can use to represent a matrix. - -The \c Eigen/Dense header file defines all member functions for the MatrixXd type and related types (see also the \ref QuickRef_Headers "table of header files"). All classes and functions defined in this header file (and other Eigen header files) are in the \c Eigen namespace. - -The first line of the \c main function declares a variable of type \c MatrixXd and specifies that it is a matrix with 2 rows and 2 columns (the entries are not initialized). The statement m(0,0) = 3 sets the entry in the top-left corner to 3. You need to use round parentheses to refer to entries in the matrix. As usual in computer science, the index of the first index is 0, as opposed to the convention in mathematics that the first index is 1. - -The following three statements sets the other three entries. The final line outputs the matrix \c m to the standard output stream. - - -\section GettingStartedExample2 Example 2: Matrices and vectors - -Here is another example, which combines matrices with vectors. Concentrate on the left-hand program for now; we will talk about the right-hand program later. - - - - -
Size set at run time:Size set at compile time:
-\include QuickStart_example2_dynamic.cpp - -\include QuickStart_example2_fixed.cpp -
- -The output is as follows: - -\include QuickStart_example2_dynamic.out - - -\section GettingStartedExplanation2 Explanation of the second example - -The second example starts by declaring a 3-by-3 matrix \c m which is initialized using the \link DenseBase::Random(Index,Index) Random() \endlink method with random values between -1 and 1. The next line applies a linear mapping such that the values are between 10 and 110. The function call \link DenseBase::Constant(Index,Index,const Scalar&) MatrixXd::Constant\endlink(3,3,1.2) returns a 3-by-3 matrix expression having all coefficients equal to 1.2. The rest is standard arithmetics. - -The next line of the \c main function introduces a new type: \c VectorXd. This represents a (column) vector of arbitrary size. Here, the vector \c v is created to contain \c 3 coefficients which are left unitialized. The one but last line uses the so-called comma-initializer, explained in \ref TutorialAdvancedInitialization, to set all coefficients of the vector \c v to be as follows: - -\f[ -v = -\begin{bmatrix} - 1 \\ - 2 \\ - 3 -\end{bmatrix}. -\f] - -The final line of the program multiplies the matrix \c m with the vector \c v and outputs the result. - -Now look back at the second example program. We presented two versions of it. In the version in the left column, the matrix is of type \c MatrixXd which represents matrices of arbitrary size. The version in the right column is similar, except that the matrix is of type \c Matrix3d, which represents matrices of a fixed size (here 3-by-3). Because the type already encodes the size of the matrix, it is not necessary to specify the size in the constructor; compare MatrixXd m(3,3) with Matrix3d m. Similarly, we have \c VectorXd on the left (arbitrary size) versus \c Vector3d on the right (fixed size). Note that here the coefficients of vector \c v are directly set in the constructor, though the same syntax of the left example could be used too. - -The use of fixed-size matrices and vectors has two advantages. The compiler emits better (faster) code because it knows the size of the matrices and vectors. Specifying the size in the type also allows for more rigorous checking at compile-time. For instance, the compiler will complain if you try to multiply a \c Matrix4d (a 4-by-4 matrix) with a \c Vector3d (a vector of size 3). However, the use of many types increases compilation time and the size of the executable. The size of the matrix may also not be known at compile-time. A rule of thumb is to use fixed-size matrices for size 4-by-4 and smaller. - - -\section GettingStartedConclusion Where to go from here? - -It's worth taking the time to read the \ref TutorialMatrixClass "long tutorial". - -However if you think you don't need it, you can directly use the classes documentation and our \ref QuickRefPage. - -\li \b Next: \ref TutorialMatrixClass - -*/ - -} - diff --git a/testbed/nanogui/ext/eigen/doc/SparseLinearSystems.dox b/testbed/nanogui/ext/eigen/doc/SparseLinearSystems.dox deleted file mode 100644 index c00be10d..00000000 --- a/testbed/nanogui/ext/eigen/doc/SparseLinearSystems.dox +++ /dev/null @@ -1,183 +0,0 @@ -namespace Eigen { -/** \eigenManualPage TopicSparseSystems Solving Sparse Linear Systems -In Eigen, there are several methods available to solve linear systems when the coefficient matrix is sparse. Because of the special representation of this class of matrices, special care should be taken in order to get a good performance. See \ref TutorialSparse for a detailed introduction about sparse matrices in Eigen. This page lists the sparse solvers available in Eigen. The main steps that are common to all these linear solvers are introduced as well. Depending on the properties of the matrix, the desired accuracy, the end-user is able to tune those steps in order to improve the performance of its code. Note that it is not required to know deeply what's hiding behind these steps: the last section presents a benchmark routine that can be easily used to get an insight on the performance of all the available solvers. - -\eigenAutoToc - -\section TutorialSparseDirectSolvers Sparse solvers - -%Eigen currently provides a limited set of built-in solvers, as well as wrappers to external solver libraries. -They are summarized in the following table: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ClassModuleSolver kindMatrix kindFeatures related to performanceDependencies,License

Notes

SimplicialLLT \link SparseCholesky_Module SparseCholesky \endlinkDirect LLt factorizationSPDFill-in reducingbuilt-in, LGPLSimplicialLDLT is often preferable
SimplicialLDLT \link SparseCholesky_Module SparseCholesky \endlinkDirect LDLt factorizationSPDFill-in reducingbuilt-in, LGPLRecommended for very sparse and not too large problems (e.g., 2D Poisson eq.)
ConjugateGradient\link IterativeLinearSolvers_Module IterativeLinearSolvers \endlinkClassic iterative CGSPDPreconditionningbuilt-in, MPL2Recommended for large symmetric problems (e.g., 3D Poisson eq.)
BiCGSTAB\link IterativeLinearSolvers_Module IterativeLinearSolvers \endlinkIterative stabilized bi-conjugate gradientSquarePreconditionningbuilt-in, MPL2To speedup the convergence, try it with the \ref IncompleteLUT preconditioner.
SparseLU \link SparseLU_Module SparseLU \endlink LU factorization Square Fill-in reducing, Leverage fast dense algebra built-in, MPL2 optimized for small and large problems with irregular patterns
SparseQR \link SparseQR_Module SparseQR \endlink QR factorizationAny, rectangular Fill-in reducingbuilt-in, MPL2recommended for least-square problems, has a basic rank-revealing feature
Wrappers to external solvers
PastixLLT \n PastixLDLT \n PastixLU\link PaStiXSupport_Module PaStiXSupport \endlinkDirect LLt, LDLt, LU factorizationsSPD \n SPD \n SquareFill-in reducing, Leverage fast dense algebra, MultithreadingRequires the PaStiX package, \b CeCILL-C optimized for tough problems and symmetric patterns
CholmodSupernodalLLT\link CholmodSupport_Module CholmodSupport \endlinkDirect LLt factorizationSPDFill-in reducing, Leverage fast dense algebraRequires the SuiteSparse package, \b GPL
UmfPackLU\link UmfPackSupport_Module UmfPackSupport \endlinkDirect LU factorizationSquareFill-in reducing, Leverage fast dense algebraRequires the SuiteSparse package, \b GPL
SuperLU\link SuperLUSupport_Module SuperLUSupport \endlinkDirect LU factorizationSquareFill-in reducing, Leverage fast dense algebraRequires the SuperLU library, (BSD-like)
SPQR\link SPQRSupport_Module SPQRSupport \endlink QR factorization Any, rectangularfill-in reducing, multithreaded, fast dense algebra requires the SuiteSparse package, \b GPL recommended for linear least-squares problems, has a rank-revealing feature
- -Here \c SPD means symmetric positive definite. - -All these solvers follow the same general concept. -Here is a typical and general example: -\code -#include -// ... -SparseMatrix A; -// fill A -VectorXd b, x; -// fill b -// solve Ax = b -SolverClassName > solver; -solver.compute(A); -if(solver.info()!=Success) { - // decomposition failed - return; -} -x = solver.solve(b); -if(solver.info()!=Success) { - // solving failed - return; -} -// solve for another right hand side: -x1 = solver.solve(b1); -\endcode - -For \c SPD solvers, a second optional template argument allows to specify which triangular part have to be used, e.g.: - -\code -#include - -ConjugateGradient, Eigen::Upper> solver; -x = solver.compute(A).solve(b); -\endcode -In the above example, only the upper triangular part of the input matrix A is considered for solving. The opposite triangle might either be empty or contain arbitrary values. - -In the case where multiple problems with the same sparsity pattern have to be solved, then the "compute" step can be decomposed as follow: -\code -SolverClassName > solver; -solver.analyzePattern(A); // for this step the numerical values of A are not used -solver.factorize(A); -x1 = solver.solve(b1); -x2 = solver.solve(b2); -... -A = ...; // modify the values of the nonzeros of A, the nonzeros pattern must stay unchanged -solver.factorize(A); -x1 = solver.solve(b1); -x2 = solver.solve(b2); -... -\endcode -The compute() method is equivalent to calling both analyzePattern() and factorize(). - -Finally, each solver provides some specific features, such as determinant, access to the factors, controls of the iterations, and so on. -More details are availble in the documentations of the respective classes. - -\section TheSparseCompute The Compute Step -In the compute() function, the matrix is generally factorized: LLT for self-adjoint matrices, LDLT for general hermitian matrices, LU for non hermitian matrices and QR for rectangular matrices. These are the results of using direct solvers. For this class of solvers precisely, the compute step is further subdivided into analyzePattern() and factorize(). - -The goal of analyzePattern() is to reorder the nonzero elements of the matrix, such that the factorization step creates less fill-in. This step exploits only the structure of the matrix. Hence, the results of this step can be used for other linear systems where the matrix has the same structure. Note however that sometimes, some external solvers (like SuperLU) require that the values of the matrix are set in this step, for instance to equilibrate the rows and columns of the matrix. In this situation, the results of this step should not be used with other matrices. - -Eigen provides a limited set of methods to reorder the matrix in this step, either built-in (COLAMD, AMD) or external (METIS). These methods are set in template parameter list of the solver : -\code -DirectSolverClassName, OrderingMethod > solver; -\endcode - -See the \link OrderingMethods_Module OrderingMethods module \endlink for the list of available methods and the associated options. - -In factorize(), the factors of the coefficient matrix are computed. This step should be called each time the values of the matrix change. However, the structural pattern of the matrix should not change between multiple calls. - -For iterative solvers, the compute step is used to eventually setup a preconditioner. For instance, with the ILUT preconditioner, the incomplete factors L and U are computed in this step. Remember that, basically, the goal of the preconditioner is to speedup the convergence of an iterative method by solving a modified linear system where the coefficient matrix has more clustered eigenvalues. For real problems, an iterative solver should always be used with a preconditioner. In Eigen, a preconditioner is selected by simply adding it as a template parameter to the iterative solver object. -\code -IterativeSolverClassName, PreconditionerName > solver; -\endcode -The member function preconditioner() returns a read-write reference to the preconditioner - to directly interact with it. See the \link IterativeLinearSolvers_Module Iterative solvers module \endlink and the documentation of each class for the list of available methods. - -\section TheSparseSolve The Solve step -The solve() function computes the solution of the linear systems with one or many right hand sides. -\code -X = solver.solve(B); -\endcode -Here, B can be a vector or a matrix where the columns form the different right hand sides. The solve() function can be called several times as well, for instance when all the right hand sides are not available at once. -\code -x1 = solver.solve(b1); -// Get the second right hand side b2 -x2 = solver.solve(b2); -// ... -\endcode -For direct methods, the solution are computed at the machine precision. Sometimes, the solution need not be too accurate. In this case, the iterative methods are more suitable and the desired accuracy can be set before the solve step using \b setTolerance(). For all the available functions, please, refer to the documentation of the \link IterativeLinearSolvers_Module Iterative solvers module \endlink. - -\section BenchmarkRoutine -Most of the time, all you need is to know how much time it will take to qolve your system, and hopefully, what is the most suitable solver. In Eigen, we provide a benchmark routine that can be used for this purpose. It is very easy to use. In the build directory, navigate to bench/spbench and compile the routine by typing \b make \e spbenchsolver. Run it with --help option to get the list of all available options. Basically, the matrices to test should be in MatrixMarket Coordinate format, and the routine returns the statistics from all available solvers in Eigen. - -The following table gives an example of XML statistics from several Eigen built-in and external solvers. - - -
Matrix N NNZ UMFPACK SUPERLU PASTIX LU BiCGSTAB BiCGSTAB+ILUT GMRES+ILUT LDLT CHOLMOD LDLT PASTIX LDLT LLT CHOLMOD SP LLT CHOLMOD LLT PASTIX LLT CG
vector_graphics 12855 72069 Compute Time 0.02545490.02156770.07018270.0001533880.01401070.01537090.01016010.009305020.0649689 -
Solve Time 0.003378350.0009518260.004843730.03748860.00464450.008477540.0005418130.0002936960.00485376 -
Total Time 0.02883330.02251950.07502650.0376420.01865520.02384840.01070190.009598710.0698227 -
Error(Iter) 1.299e-16 2.04207e-16 4.83393e-15 3.94856e-11 (80) 1.03861e-12 (3) 5.81088e-14 (6) 1.97578e-16 1.83927e-16 4.24115e-15 -
poisson_SPD 19788 308232 Compute Time 0.4250261.823780.6173670.0004789211.340011.334710.7964190.8575730.4730070.8148260.1847190.8615550.4705590.000458188 -
Solve Time 0.02800530.01944020.02687470.2494370.05484440.09269910.008502040.00531710.02589320.008746030.005781550.005303610.02489420.239093 -
Total Time 0.4530311.843220.6442410.2499161.394861.427410.8049210.8628910.49890.8235720.1905010.8668590.4954530.239551 -
Error(Iter) 4.67146e-16 1.068e-15 1.3397e-15 6.29233e-11 (201) 3.68527e-11 (6) 3.3168e-15 (16) 1.86376e-15 1.31518e-16 1.42593e-15 3.45361e-15 3.14575e-16 2.21723e-15 7.21058e-16 9.06435e-12 (261) -
sherman2 1080 23094 Compute Time 0.006317540.0150520.0247514 -0.02144250.0217988 -
Solve Time 0.0004784240.0003379980.0010291 -0.002431520.00246152 -
Total Time 0.006795970.015390.0257805 -0.0238740.0242603 -
Error(Iter) 1.83099e-15 8.19351e-15 2.625e-14 1.3678e+69 (1080) 4.1911e-12 (7) 5.0299e-13 (12) -
bcsstk01_SPD 48 400 Compute Time 0.0001690790.000107890.0005725381.425e-069.1612e-058.3985e-055.6489e-057.0913e-050.0004682515.7389e-058.0212e-055.8394e-050.0004630171.333e-06 -
Solve Time 1.2288e-051.1124e-050.0002863878.5896e-051.6381e-051.6984e-053.095e-064.115e-060.0003254383.504e-067.369e-063.454e-060.0002940956.0516e-05 -
Total Time 0.0001813670.0001190140.0008589258.7321e-050.0001079930.0001009695.9584e-057.5028e-050.0007936896.0893e-058.7581e-056.1848e-050.0007571126.1849e-05 -
Error(Iter) 1.03474e-16 2.23046e-16 2.01273e-16 4.87455e-07 (48) 1.03553e-16 (2) 3.55965e-16 (2) 2.48189e-16 1.88808e-16 1.97976e-16 2.37248e-16 1.82701e-16 2.71474e-16 2.11322e-16 3.547e-09 (48) -
sherman1 1000 3750 Compute Time 0.002288050.002092310.005282689.846e-060.001635220.001621550.0007892590.0008044950.00438269 -
Solve Time 0.0002137889.7983e-050.0009388310.006298350.0003617640.000787944.3989e-052.5331e-050.000917166 -
Total Time 0.002501840.002190290.006221510.00630820.001996980.002409490.0008332480.0008298260.00529986 -
Error(Iter) 1.16839e-16 2.25968e-16 2.59116e-16 3.76779e-11 (248) 4.13343e-11 (4) 2.22347e-14 (10) 2.05861e-16 1.83555e-16 1.02917e-15 -
young1c 841 4089 Compute Time 0.002358430.002172280.005680751.2735e-050.002648660.00258236 -
Solve Time 0.0003295990.0001686340.000801180.05347380.001871930.00450211 -
Total Time 0.002688030.002340910.006481930.05348650.004520590.00708447 -
Error(Iter) 1.27029e-16 2.81321e-16 5.0492e-15 8.0507e-11 (706) 3.00447e-12 (8) 1.46532e-12 (16) -
mhd1280b 1280 22778 Compute Time 0.002348980.002070790.005709182.5976e-050.003025630.002980360.001445250.0009199220.00426444 -
Solve Time 0.001033920.0002119110.001050.01104320.0006282870.003920890.0001383036.2446e-050.00097564 -
Total Time 0.00338290.00228270.006759180.01106920.003653920.006901240.001583550.0009823680.00524008 -
Error(Iter) 1.32953e-16 3.08646e-16 6.734e-16 8.83132e-11 (40) 1.51153e-16 (1) 6.08556e-16 (8) 1.89264e-16 1.97477e-16 6.68126e-09 -
crashbasis 160000 1750416 Compute Time 3.20195.789215.75730.003835153.10063.09921 -
Solve Time 0.2619150.1062250.4021411.490890.248880.443673 -
Total Time 3.463815.8954216.15941.494733.349483.54288 -
Error(Iter) 1.76348e-16 4.58395e-16 1.67982e-14 8.64144e-11 (61) 8.5996e-12 (2) 6.04042e-14 (5) - -
-*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/SparseQuickReference.dox b/testbed/nanogui/ext/eigen/doc/SparseQuickReference.dox deleted file mode 100644 index d04ac35c..00000000 --- a/testbed/nanogui/ext/eigen/doc/SparseQuickReference.dox +++ /dev/null @@ -1,248 +0,0 @@ -namespace Eigen { -/** \eigenManualPage SparseQuickRefPage Quick reference guide for sparse matrices -\eigenAutoToc - -
- -In this page, we give a quick summary of the main operations available for sparse matrices in the class SparseMatrix. First, it is recommended to read the introductory tutorial at \ref TutorialSparse. The important point to have in mind when working on sparse matrices is how they are stored : -i.e either row major or column major. The default is column major. Most arithmetic operations on sparse matrices will assert that they have the same storage order. - -\section SparseMatrixInit Sparse Matrix Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Category Operations Notes
Constructor -\code - SparseMatrix sm1(1000,1000); - SparseMatrix,RowMajor> sm2; -\endcode - Default is ColMajor
Resize/Reserve - \code - sm1.resize(m,n); //Change sm1 to a m x n matrix. - sm1.reserve(nnz); // Allocate room for nnz nonzeros elements. - \endcode - Note that when calling reserve(), it is not required that nnz is the exact number of nonzero elements in the final matrix. However, an exact estimation will avoid multiple reallocations during the insertion phase.
Assignment -\code - SparseMatrix sm1; - // Initialize sm2 with sm1. - SparseMatrix sm2(sm1), sm3; - // Assignment and evaluations modify the storage order. - sm3 = sm1; - \endcode - The copy constructor can be used to convert from a storage order to another
Element-wise Insertion -\code -// Insert a new element; - sm1.insert(i, j) = v_ij; - -// Update the value v_ij - sm1.coeffRef(i,j) = v_ij; - sm1.coeffRef(i,j) += v_ij; - sm1.coeffRef(i,j) -= v_ij; -\endcode - insert() assumes that the element does not already exist; otherwise, use coeffRef()
Batch insertion -\code - std::vector< Eigen::Triplet > tripletList; - tripletList.reserve(estimation_of_entries); - // -- Fill tripletList with nonzero elements... - sm1.setFromTriplets(TripletList.begin(), TripletList.end()); -\endcode -A complete example is available at \link TutorialSparseFilling Triplet Insertion \endlink.
Constant or Random Insertion -\code -sm1.setZero(); -\endcode -Remove all non-zero coefficients
- - -\section SparseBasicInfos Matrix properties -Beyond the basic functions rows() and cols(), there are some useful functions that are available to easily get some informations from the matrix. - - - - -
\code - sm1.rows(); // Number of rows - sm1.cols(); // Number of columns - sm1.nonZeros(); // Number of non zero values - sm1.outerSize(); // Number of columns (resp. rows) for a column major (resp. row major ) - sm1.innerSize(); // Number of rows (resp. columns) for a row major (resp. column major) - sm1.norm(); // Euclidian norm of the matrix - sm1.squaredNorm(); // Squared norm of the matrix - sm1.blueNorm(); - sm1.isVector(); // Check if sm1 is a sparse vector or a sparse matrix - sm1.isCompressed(); // Check if sm1 is in compressed form - ... - \endcode
- -\section SparseBasicOps Arithmetic operations -It is easy to perform arithmetic operations on sparse matrices provided that the dimensions are adequate and that the matrices have the same storage order. Note that the evaluation can always be done in a matrix with a different storage order. In the following, \b sm denotes a sparse matrix, \b dm a dense matrix and \b dv a dense vector. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Operations Code Notes
add subtract \code - sm3 = sm1 + sm2; - sm3 = sm1 - sm2; - sm2 += sm1; - sm2 -= sm1; \endcode - - sm1 and sm2 should have the same storage order -
- scalar product\code - sm3 = sm1 * s1; sm3 *= s1; - sm3 = s1 * sm1 + s2 * sm2; sm3 /= s1;\endcode - - Many combinations are possible if the dimensions and the storage order agree. -
%Sparse %Product \code - sm3 = sm1 * sm2; - dm2 = sm1 * dm1; - dv2 = sm1 * dv1; - \endcode -
transposition, adjoint \code - sm2 = sm1.transpose(); - sm2 = sm1.adjoint(); - \endcode - Note that the transposition change the storage order. There is no support for transposeInPlace(). -
Permutation -\code -perm.indices(); // Reference to the vector of indices -sm1.twistedBy(perm); // Permute rows and columns -sm2 = sm1 * perm; //Permute the columns -sm2 = perm * sm1; // Permute the columns -\endcode - - -
- Component-wise ops - \code - sm1.cwiseProduct(sm2); - sm1.cwiseQuotient(sm2); - sm1.cwiseMin(sm2); - sm1.cwiseMax(sm2); - sm1.cwiseAbs(); - sm1.cwiseSqrt(); - \endcode - sm1 and sm2 should have the same storage order -
- -\section sparseotherops Other supported operations - - - - - - - - - - - - - - - - - - - - - - - - - - -
Operations Code Notes
Sub-matrices -\code - sm1.block(startRow, startCol, rows, cols); - sm1.block(startRow, startCol); - sm1.topLeftCorner(rows, cols); - sm1.topRightCorner(rows, cols); - sm1.bottomLeftCorner( rows, cols); - sm1.bottomRightCorner( rows, cols); - \endcode -
Range -\code - sm1.innerVector(outer); - sm1.innerVectors(start, size); - sm1.leftCols(size); - sm2.rightCols(size); - sm1.middleRows(start, numRows); - sm1.middleCols(start, numCols); - sm1.col(j); -\endcode -A inner vector is either a row (for row-major) or a column (for column-major). As stated earlier, the evaluation can be done in a matrix with different storage order
Triangular and selfadjoint views -\code - sm2 = sm1.triangularview(); - sm2 = sm1.selfadjointview(); -\endcode - Several combination between triangular views and blocks views are possible -\code - \endcode
Triangular solve -\code - dv2 = sm1.triangularView().solve(dv1); - dv2 = sm1.topLeftCorner(size, size).triangularView().solve(dv1); -\endcode - For general sparse solve, Use any suitable module described at \ref TopicSparseSystems
Low-level API -\code -sm1.valuePtr(); // Pointer to the values -sm1.innerIndextr(); // Pointer to the indices. -sm1.outerIndexPtr(); //Pointer to the beginning of each inner vector -\endcode - If the matrix is not in compressed form, makeCompressed() should be called before. Note that these functions are mostly provided for interoperability purposes with external libraries. A better access to the values of the matrix is done by using the InnerIterator class as described in \link TutorialSparse the Tutorial Sparse \endlink section
-*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/StlContainers.dox b/testbed/nanogui/ext/eigen/doc/StlContainers.dox deleted file mode 100644 index d8d0d529..00000000 --- a/testbed/nanogui/ext/eigen/doc/StlContainers.dox +++ /dev/null @@ -1,62 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TopicStlContainers Using STL Containers with Eigen - -\eigenAutoToc - -\section summary Executive summary - -Using STL containers on \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types", or classes having members of such types, requires taking the following two steps: - -\li A 16-byte-aligned allocator must be used. Eigen does provide one ready for use: aligned_allocator. -\li If you want to use the std::vector container, you need to \#include . - -These issues arise only with \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types" and \ref TopicStructHavingEigenMembers "structures having such Eigen objects as member". For other Eigen types, such as Vector3f or MatrixXd, no special care is needed when using STL containers. - -\section allocator Using an aligned allocator - -STL containers take an optional template parameter, the allocator type. When using STL containers on \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types", you need tell the container to use an allocator that will always allocate memory at 16-byte-aligned locations. Fortunately, Eigen does provide such an allocator: Eigen::aligned_allocator. - -For example, instead of -\code -std::map -\endcode -you need to use -\code -std::map, - Eigen::aligned_allocator > > -\endcode -Note that the third parameter "std::less" is just the default value, but we have to include it because we want to specify the fourth parameter, which is the allocator type. - -\section vector The case of std::vector - -The situation with std::vector was even worse (explanation below) so we had to specialize it for the Eigen::aligned_allocator type. In practice you \b must use the Eigen::aligned_allocator (not another aligned allocator), \b and \#include . - -Here is an example: -\code -#include -/* ... */ -std::vector > -\endcode - -\subsection vector_spec An alternative - specializing std::vector for Eigen types - -As an alternative to the recommended approach described above, you have the option to specialize std::vector for Eigen types requiring alignment. -The advantage is that you won't need to declare std::vector all over with Eigen::allocator. One drawback on the other hand side is that -the specialization needs to be defined before all code pieces in which e.g. std::vector is used. Otherwise, without knowing the specialization -the compiler will compile that particular instance with the default std::allocator and you program is most likely to crash. - -Here is an example: -\code -#include -/* ... */ -EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix2d) -std::vector -\endcode - -\b Explanation: The resize() method of std::vector takes a value_type argument (defaulting to value_type()). So with std::vector, some Eigen::Vector4f objects will be passed by value, which discards any alignment modifiers, so a Eigen::Vector4f can be created at an unaligned location. In order to avoid that, the only solution we saw was to specialize std::vector to make it work on a slight modification of, here, Eigen::Vector4f, that is able to deal properly with this situation. - - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/StorageOrders.dox b/testbed/nanogui/ext/eigen/doc/StorageOrders.dox deleted file mode 100644 index 61645313..00000000 --- a/testbed/nanogui/ext/eigen/doc/StorageOrders.dox +++ /dev/null @@ -1,86 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TopicStorageOrders Storage orders - -There are two different storage orders for matrices and two-dimensional arrays: column-major and row-major. -This page explains these storage orders and how to specify which one should be used. - -\eigenAutoToc - - -\section TopicStorageOrdersIntro Column-major and row-major storage - -The entries of a matrix form a two-dimensional grid. However, when the matrix is stored in memory, the entries -have to somehow be laid out linearly. There are two main ways to do this, by row and by column. - -We say that a matrix is stored in \b row-major order if it is stored row by row. The entire first row is -stored first, followed by the entire second row, and so on. Consider for example the matrix - -\f[ -A = \begin{bmatrix} -8 & 2 & 2 & 9 \\ -9 & 1 & 4 & 4 \\ -3 & 5 & 4 & 5 -\end{bmatrix}. -\f] - -If this matrix is stored in row-major order, then the entries are laid out in memory as follows: - -\code 8 2 2 9 9 1 4 4 3 5 4 5 \endcode - -On the other hand, a matrix is stored in \b column-major order if it is stored column by column, starting with -the entire first column, followed by the entire second column, and so on. If the above matrix is stored in -column-major order, it is laid out as follows: - -\code 8 9 3 2 1 5 2 4 4 9 4 5 \endcode - -This example is illustrated by the following Eigen code. It uses the PlainObjectBase::data() function, which -returns a pointer to the memory location of the first entry of the matrix. - - - - -
ExampleOutput
-\include TopicStorageOrders_example.cpp - -\verbinclude TopicStorageOrders_example.out -
- - -\section TopicStorageOrdersInEigen Storage orders in Eigen - -The storage order of a matrix or a two-dimensional array can be set by specifying the \c Options template -parameter for Matrix or Array. As \ref TutorialMatrixClass explains, the %Matrix class template has six -template parameters, of which three are compulsory (\c Scalar, \c RowsAtCompileTime and \c ColsAtCompileTime) -and three are optional (\c Options, \c MaxRowsAtCompileTime and \c MaxColsAtCompileTime). If the \c Options -parameter is set to \c RowMajor, then the matrix or array is stored in row-major order; if it is set to -\c ColMajor, then it is stored in column-major order. This mechanism is used in the above Eigen program to -specify the storage order. - -If the storage order is not specified, then Eigen defaults to storing the entry in column-major. This is also -the case if one of the convenience typedefs (\c Matrix3f, \c ArrayXXd, etc.) is used. - -Matrices and arrays using one storage order can be assigned to matrices and arrays using the other storage -order, as happens in the above program when \c Arowmajor is initialized using \c Acolmajor. Eigen will reorder -the entries automatically. More generally, row-major and column-major matrices can be mixed in an expression -as we want. - - -\section TopicStorageOrdersWhich Which storage order to choose? - -So, which storage order should you use in your program? There is no simple answer to this question; it depends -on your application. Here are some points to keep in mind: - - - Your users may expect you to use a specific storage order. Alternatively, you may use other libraries than - Eigen, and these other libraries may expect a certain storage order. In these cases it may be easiest and - fastest to use this storage order in your whole program. - - Algorithms that traverse a matrix row by row will go faster when the matrix is stored in row-major order - because of better data locality. Similarly, column-by-column traversal is faster for column-major - matrices. It may be worthwhile to experiment a bit to find out what is faster for your particular - application. - - The default in Eigen is column-major. Naturally, most of the development and testing of the Eigen library - is thus done with column-major matrices. This means that, even though we aim to support column-major and - row-major storage orders transparently, the Eigen library may well work best with column-major matrices. - -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/StructHavingEigenMembers.dox b/testbed/nanogui/ext/eigen/doc/StructHavingEigenMembers.dox deleted file mode 100644 index 74a8d521..00000000 --- a/testbed/nanogui/ext/eigen/doc/StructHavingEigenMembers.dox +++ /dev/null @@ -1,190 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TopicStructHavingEigenMembers Structures Having Eigen Members - -\eigenAutoToc - -\section summary Executive Summary - -If you define a structure having members of \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types", you must overload its "operator new" so that it generates 16-bytes-aligned pointers. Fortunately, Eigen provides you with a macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW that does that for you. - -\section what What kind of code needs to be changed? - -The kind of code that needs to be changed is this: - -\code -class Foo -{ - ... - Eigen::Vector2d v; - ... -}; - -... - -Foo *foo = new Foo; -\endcode - -In other words: you have a class that has as a member a \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen object", and then you dynamically create an object of that class. - -\section how How should such code be modified? - -Very easy, you just need to put a EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro in a public part of your class, like this: - -\code -class Foo -{ - ... - Eigen::Vector2d v; - ... -public: - EIGEN_MAKE_ALIGNED_OPERATOR_NEW -}; - -... - -Foo *foo = new Foo; -\endcode - -This macro makes "new Foo" always return an aligned pointer. - -If this approach is too intrusive, see also the \ref othersolutions. - -\section why Why is this needed? - -OK let's say that your code looks like this: - -\code -class Foo -{ - ... - Eigen::Vector2d v; - ... -}; - -... - -Foo *foo = new Foo; -\endcode - -A Eigen::Vector2d consists of 2 doubles, which is 128 bits. Which is exactly the size of a SSE packet, which makes it possible to use SSE for all sorts of operations on this vector. But SSE instructions (at least the ones that Eigen uses, which are the fast ones) require 128-bit alignment. Otherwise you get a segmentation fault. - -For this reason, Eigen takes care by itself to require 128-bit alignment for Eigen::Vector2d, by doing two things: -\li Eigen requires 128-bit alignment for the Eigen::Vector2d's array (of 2 doubles). With GCC, this is done with a __attribute__ ((aligned(16))). -\li Eigen overloads the "operator new" of Eigen::Vector2d so it will always return 128-bit aligned pointers. - -Thus, normally, you don't have to worry about anything, Eigen handles alignment for you... - -... except in one case. When you have a class Foo like above, and you dynamically allocate a new Foo as above, then, since Foo doesn't have aligned "operator new", the returned pointer foo is not necessarily 128-bit aligned. - -The alignment attribute of the member v is then relative to the start of the class, foo. If the foo pointer wasn't aligned, then foo->v won't be aligned either! - -The solution is to let class Foo have an aligned "operator new", as we showed in the previous section. - -\section movetotop Should I then put all the members of Eigen types at the beginning of my class? - -That's not required. Since Eigen takes care of declaring 128-bit alignment, all members that need it are automatically 128-bit aligned relatively to the class. So code like this works fine: - -\code -class Foo -{ - double x; - Eigen::Vector2d v; -public: - EIGEN_MAKE_ALIGNED_OPERATOR_NEW -}; -\endcode - -\section dynamicsize What about dynamic-size matrices and vectors? - -Dynamic-size matrices and vectors, such as Eigen::VectorXd, allocate dynamically their own array of coefficients, so they take care of requiring absolute alignment automatically. So they don't cause this issue. The issue discussed here is only with \ref TopicFixedSizeVectorizable "fixed-size vectorizable matrices and vectors". - -\section bugineigen So is this a bug in Eigen? - -No, it's not our bug. It's more like an inherent problem of the C++98 language specification, and seems to be taken care of in the upcoming language revision: see this document. - -\section conditional What if I want to do this conditionnally (depending on template parameters) ? - -For this situation, we offer the macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign). It will generate aligned operators like EIGEN_MAKE_ALIGNED_OPERATOR_NEW if NeedsToAlign is true. It will generate operators with the default alignment if NeedsToAlign is false. - -Example: - -\code -template class Foo -{ - typedef Eigen::Matrix Vector; - enum { NeedsToAlign = (sizeof(Vector)%16)==0 }; - ... - Vector v; - ... -public: - EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) -}; - -... - -Foo<4> *foo4 = new Foo<4>; // foo4 is guaranteed to be 128bit-aligned -Foo<3> *foo3 = new Foo<3>; // foo3 has only the system default alignment guarantee -\endcode - - -\section othersolutions Other solutions - -In case putting the EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro everywhere is too intrusive, there exists at least two other solutions. - -\subsection othersolutions1 Disabling alignment - -The first is to disable alignment requirement for the fixed size members: -\code -class Foo -{ - ... - Eigen::Matrix v; - ... -}; -\endcode -This has for effect to disable vectorization when using \c v. -If a function of Foo uses it several times, then it still possible to re-enable vectorization by copying it into an aligned temporary vector: -\code -void Foo::bar() -{ - Eigen::Vector2d av(v); - // use av instead of v - ... - // if av changed, then do: - v = av; -} -\endcode - -\subsection othersolutions2 Private structure - -The second consist in storing the fixed-size objects into a private struct which will be dynamically allocated at the construction time of the main object: - -\code -struct Foo_d -{ - EIGEN_MAKE_ALIGNED_OPERATOR_NEW - Vector2d v; - ... -}; - - -struct Foo { - Foo() { init_d(); } - ~Foo() { delete d; } - void bar() - { - // use d->v instead of v - ... - } -private: - void init_d() { d = new Foo_d; } - Foo_d* d; -}; -\endcode - -The clear advantage here is that the class Foo remains unchanged regarding alignment issues. The drawback is that a heap allocation will be required whatsoever. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TemplateKeyword.dox b/testbed/nanogui/ext/eigen/doc/TemplateKeyword.dox deleted file mode 100644 index f4e4f237..00000000 --- a/testbed/nanogui/ext/eigen/doc/TemplateKeyword.dox +++ /dev/null @@ -1,132 +0,0 @@ -namespace Eigen { - -/** \page TopicTemplateKeyword The template and typename keywords in C++ - -There are two uses for the \c template and \c typename keywords in C++. One of them is fairly well known -amongst programmers: to define templates. The other use is more obscure: to specify that an expression refers -to a template function or a type. This regularly trips up programmers that use the %Eigen library, often -leading to error messages from the compiler that are difficult to understand. - -\eigenAutoToc - - -\section TopicTemplateKeywordToDefineTemplates Using the template and typename keywords to define templates - -The \c template and \c typename keywords are routinely used to define templates. This is not the topic of this -page as we assume that the reader is aware of this (otherwise consult a C++ book). The following example -should illustrate this use of the \c template keyword. - -\code -template -bool isPositive(T x) -{ - return x > 0; -} -\endcode - -We could just as well have written template <class T>; the keywords \c typename and \c class have the -same meaning in this context. - - -\section TopicTemplateKeywordExample An example showing the second use of the template keyword - -Let us illustrate the second use of the \c template keyword with an example. Suppose we want to write a -function which copies all entries in the upper triangular part of a matrix into another matrix, while keeping -the lower triangular part unchanged. A straightforward implementation would be as follows: - - - - -
Example:Output:
-\include TemplateKeyword_simple.cpp - -\verbinclude TemplateKeyword_simple.out -
- -That works fine, but it is not very flexible. First, it only works with dynamic-size matrices of -single-precision floats; the function \c copyUpperTriangularPart() does not accept static-size matrices or -matrices with double-precision numbers. Second, if you use an expression such as -mat.topLeftCorner(3,3) as the parameter \c src, then this is copied into a temporary variable of type -MatrixXf; this copy can be avoided. - -As explained in \ref TopicFunctionTakingEigenTypes, both issues can be resolved by making -\c copyUpperTriangularPart() accept any object of type MatrixBase. This leads to the following code: - - - - -
Example:Output:
-\include TemplateKeyword_flexible.cpp - -\verbinclude TemplateKeyword_flexible.out -
- -The one line in the body of the function \c copyUpperTriangularPart() shows the second, more obscure use of -the \c template keyword in C++. Even though it may look strange, the \c template keywords are necessary -according to the standard. Without it, the compiler may reject the code with an error message like "no match -for operator<". - - -\section TopicTemplateKeywordExplanation Explanation - -The reason that the \c template keyword is necessary in the last example has to do with the rules for how -templates are supposed to be compiled in C++. The compiler has to check the code for correct syntax at the -point where the template is defined, without knowing the actual value of the template arguments (\c Derived1 -and \c Derived2 in the example). That means that the compiler cannot know that dst.triangularPart is -a member template and that the following < symbol is part of the delimiter for the template -parameter. Another possibility would be that dst.triangularPart is a member variable with the < -symbol refering to the operator<() function. In fact, the compiler should choose the second -possibility, according to the standard. If dst.triangularPart is a member template (as in our case), -the programmer should specify this explicitly with the \c template keyword and write dst.template -triangularPart. - -The precise rules are rather complicated, but ignoring some subtleties we can summarize them as follows: -- A dependent name is name that depends (directly or indirectly) on a template parameter. In the - example, \c dst is a dependent name because it is of type MatrixBase<Derived1> which depends - on the template parameter \c Derived1. -- If the code contains either one of the contructions xxx.yyy or xxx->yyy and \c xxx is a - dependent name and \c yyy refers to a member template, then the \c template keyword must be used before - \c yyy, leading to xxx.template yyy or xxx->template yyy. -- If the code contains the contruction xxx::yyy and \c xxx is a dependent name and \c yyy refers to a - member typedef, then the \c typename keyword must be used before the whole construction, leading to - typename xxx::yyy. - -As an example where the \c typename keyword is required, consider the following code in \ref TutorialSparse -for iterating over the non-zero entries of a sparse matrix type: - -\code -SparseMatrixType mat(rows,cols); -for (int k=0; k -void iterateOverSparseMatrix(const SparseMatrix& mat; -{ - for (int k=0; k::InnerIterator it(mat,k); it; ++it) - { - /* ... */ - } -} -\endcode - - -\section TopicTemplateKeywordResources Resources for further reading - -For more information and a fuller explanation of this topic, the reader may consult the following sources: -- The book "C++ Template Metaprogramming" by David Abrahams and Aleksey Gurtovoy contains a very good - explanation in Appendix B ("The typename and template Keywords") which formed the basis for this page. -- http://pages.cs.wisc.edu/~driscoll/typename.html -- http://www.parashift.com/c++-faq-lite/templates.html#faq-35.18 -- http://www.comeaucomputing.com/techtalk/templates/#templateprefix -- http://www.comeaucomputing.com/techtalk/templates/#typename - -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicAliasing.dox b/testbed/nanogui/ext/eigen/doc/TopicAliasing.dox deleted file mode 100644 index c2654aed..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicAliasing.dox +++ /dev/null @@ -1,215 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TopicAliasing Aliasing - -In %Eigen, aliasing refers to assignment statement in which the same matrix (or array or vector) appears on the -left and on the right of the assignment operators. Statements like mat = 2 * mat; or mat = -mat.transpose(); exhibit aliasing. The aliasing in the first example is harmless, but the aliasing in the -second example leads to unexpected results. This page explains what aliasing is, when it is harmful, and what -to do about it. - -\eigenAutoToc - - -\section TopicAliasingExamples Examples - -Here is a simple example exhibiting aliasing: - - - - -
ExampleOutput
-\include TopicAliasing_block.cpp - -\verbinclude TopicAliasing_block.out -
- -The output is not what one would expect. The problem is the assignment -\code -mat.bottomRightCorner(2,2) = mat.topLeftCorner(2,2); -\endcode -This assignment exhibits aliasing: the coefficient \c mat(1,1) appears both in the block -mat.bottomRightCorner(2,2) on the left-hand side of the assignment and the block -mat.topLeftCorner(2,2) on the right-hand side. After the assignment, the (2,2) entry in the bottom -right corner should have the value of \c mat(1,1) before the assignment, which is 5. However, the output shows -that \c mat(2,2) is actually 1. The problem is that %Eigen uses lazy evaluation (see -\ref TopicEigenExpressionTemplates) for mat.topLeftCorner(2,2). The result is similar to -\code -mat(1,1) = mat(0,0); -mat(1,2) = mat(0,1); -mat(2,1) = mat(1,0); -mat(2,2) = mat(1,1); -\endcode -Thus, \c mat(2,2) is assigned the \e new value of \c mat(1,1) instead of the old value. The next section -explains how to solve this problem by calling \link DenseBase::eval() eval()\endlink. - -Aliasing occurs more naturally when trying to shrink a matrix. For example, the expressions vec = -vec.head(n) and mat = mat.block(i,j,r,c) exhibit aliasing. - -In general, aliasing cannot be detected at compile time: if \c mat in the first example were a bit bigger, -then the blocks would not overlap, and there would be no aliasing problem. However, %Eigen does detect some -instances of aliasing, albeit at run time. The following example exhibiting aliasing was mentioned in \ref -TutorialMatrixArithmetic : - - - - -
ExampleOutput
-\include tut_arithmetic_transpose_aliasing.cpp - -\verbinclude tut_arithmetic_transpose_aliasing.out -
- -Again, the output shows the aliasing issue. However, by default %Eigen uses a run-time assertion to detect this -and exits with a message like - -\verbatim -void Eigen::DenseBase::checkTransposeAliasing(const OtherDerived&) const -[with OtherDerived = Eigen::Transpose >, Derived = Eigen::Matrix]: -Assertion `(!internal::check_transpose_aliasing_selector::IsTransposed,OtherDerived>::run(internal::extract_data(derived()), other)) -&& "aliasing detected during transposition, use transposeInPlace() or evaluate the rhs into a temporary using .eval()"' failed. -\endverbatim - -The user can turn %Eigen's run-time assertions like the one to detect this aliasing problem off by defining the -EIGEN_NO_DEBUG macro, and the above program was compiled with this macro turned off in order to illustrate the -aliasing problem. See \ref TopicAssertions for more information about %Eigen's run-time assertions. - - -\section TopicAliasingSolution Resolving aliasing issues - -If you understand the cause of the aliasing issue, then it is obvious what must happen to solve it: %Eigen has -to evaluate the right-hand side fully into a temporary matrix/array and then assign it to the left-hand -side. The function \link DenseBase::eval() eval() \endlink does precisely that. - -For example, here is the corrected version of the first example above: - - - - -
ExampleOutput
-\include TopicAliasing_block_correct.cpp - -\verbinclude TopicAliasing_block_correct.out -
- -Now, \c mat(2,2) equals 5 after the assignment, as it should be. - -The same solution also works for the second example, with the transpose: simply replace the line -a = a.transpose(); with a = a.transpose().eval();. However, in this common case there is a -better solution. %Eigen provides the special-purpose function -\link DenseBase::transposeInPlace() transposeInPlace() \endlink which replaces a matrix by its transpose. -This is shown below: - - - - -
ExampleOutput
-\include tut_arithmetic_transpose_inplace.cpp - -\verbinclude tut_arithmetic_transpose_inplace.out -
- -If an xxxInPlace() function is available, then it is best to use it, because it indicates more clearly what you -are doing. This may also allow %Eigen to optimize more aggressively. These are some of the xxxInPlace() -functions provided: - - - - - - - - - -
Original functionIn-place function
MatrixBase::adjoint() MatrixBase::adjointInPlace()
DenseBase::reverse() DenseBase::reverseInPlace()
LDLT::solve() LDLT::solveInPlace()
LLT::solve() LLT::solveInPlace()
TriangularView::solve() TriangularView::solveInPlace()
DenseBase::transpose() DenseBase::transposeInPlace()
- -In the special case where a matrix or vector is shrunk using an expression like vec = vec.head(n), -you can use \link PlainObjectBase::conservativeResize() conservativeResize() \endlink. - - -\section TopicAliasingCwise Aliasing and component-wise operations - -As explained above, it may be dangerous if the same matrix or array occurs on both the left-hand side and the -right-hand side of an assignment operator, and it is then often necessary to evaluate the right-hand side -explicitly. However, applying component-wise operations (such as matrix addition, scalar multiplication and -array multiplication) is safe. - -The following example has only component-wise operations. Thus, there is no need for \link DenseBase::eval() -eval() \endlink even though the same matrix appears on both sides of the assignments. - - - - -
ExampleOutput
-\include TopicAliasing_cwise.cpp - -\verbinclude TopicAliasing_cwise.out -
- -In general, an assignment is safe if the (i,j) entry of the expression on the right-hand side depends only on -the (i,j) entry of the matrix or array on the left-hand side and not on any other entries. In that case it is -not necessary to evaluate the right-hand side explicitly. - - -\section TopicAliasingMatrixMult Aliasing and matrix multiplication - -Matrix multiplication is the only operation in %Eigen that assumes aliasing by default. Thus, if \c matA is a -matrix, then the statement matA = matA * matA; is safe. All other operations in %Eigen assume that -there are no aliasing problems, either because the result is assigned to a different matrix or because it is a -component-wise operation. - - - - -
ExampleOutput
-\include TopicAliasing_mult1.cpp - -\verbinclude TopicAliasing_mult1.out -
- -However, this comes at a price. When executing the expression matA = matA * matA, %Eigen evaluates the -product in a temporary matrix which is assigned to \c matA after the computation. This is fine. But %Eigen does -the same when the product is assigned to a different matrix (e.g., matB = matA * matA). In that case, -it is more efficient to evaluate the product directly into \c matB instead of evaluating it first into a -temporary matrix and copying that matrix to \c matB. - -The user can indicate with the \link MatrixBase::noalias() noalias()\endlink function that there is no -aliasing, as follows: matB.noalias() = matA * matA. This allows %Eigen to evaluate the matrix product -matA * matA directly into \c matB. - - - - -
ExampleOutput
-\include TopicAliasing_mult2.cpp - -\verbinclude TopicAliasing_mult2.out -
- -Of course, you should not use \c noalias() when there is in fact aliasing taking place. If you do, then you -may get wrong results: - - - - -
ExampleOutput
-\include TopicAliasing_mult3.cpp - -\verbinclude TopicAliasing_mult3.out -
- - -\section TopicAliasingSummary Summary - -Aliasing occurs when the same matrix or array coefficients appear both on the left- and the right-hand side of -an assignment operator. - - Aliasing is harmless with coefficient-wise computations; this includes scalar multiplication and matrix or - array addition. - - When you multiply two matrices, %Eigen assumes that aliasing occurs. If you know that there is no aliasing, - then you can use \link MatrixBase::noalias() noalias()\endlink. - - In all other situations, %Eigen assumes that there is no aliasing issue and thus gives the wrong result if - aliasing does in fact occur. To prevent this, you have to use \link DenseBase::eval() eval() \endlink or - one of the xxxInPlace() functions. - -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicAssertions.dox b/testbed/nanogui/ext/eigen/doc/TopicAssertions.dox deleted file mode 100644 index 4ead4017..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicAssertions.dox +++ /dev/null @@ -1,108 +0,0 @@ -namespace Eigen { - -/** \page TopicAssertions Assertions - -\eigenAutoToc - -\section PlainAssert Assertions - -The macro eigen_assert is defined to be \c eigen_plain_assert by default. We use eigen_plain_assert instead of \c assert to work around a known bug for GCC <= 4.3. Basically, eigen_plain_assert \a is \c assert. - -\subsection RedefineAssert Redefining assertions - -Both eigen_assert and eigen_plain_assert are defined in Macros.h. Defining eigen_assert indirectly gives you a chance to change its behavior. You can redefine this macro if you want to do something else such as throwing an exception, and fall back to its default behavior with eigen_plain_assert. The code below tells Eigen to throw an std::runtime_error: - -\code -#include -#undef eigen_assert -#define eigen_assert(x) \ - if (!x) { throw (std::runtime_error("Put your message here")); } -\endcode - -\subsection DisableAssert Disabling assertions - -Assertions cost run time and can be turned off. You can suppress eigen_assert by defining \c EIGEN_NO_DEBUG \b before including Eigen headers. \c EIGEN_NO_DEBUG is undefined by default unless \c NDEBUG is defined. - -\section StaticAssert Static assertions - -Static assertions are not standardized until C++11. However, in the Eigen library, there are many conditions can and should be detectedat compile time. For instance, we use static assertions to prevent the code below from compiling. - -\code -Matrix3d() + Matrix4d(); // adding matrices of different sizes -Matrix4cd() * Vector3cd(); // invalid product known at compile time -\endcode - -Static assertions are defined in StaticAssert.h. If there is native static_assert, we use it. Otherwise, we have implemented an assertion macro that can show a limited range of messages. - -One can easily come up with static assertions without messages, such as: - -\code -#define STATIC_ASSERT(x) \ - switch(0) { case 0: case x:; } -\endcode - -However, the example above obviously cannot tell why the assertion failed. Therefore, we define a \c struct in namespace Eigen::internal to handle available messages. - -\code -template -struct static_assertion {}; - -template<> -struct static_assertion -{ - enum { - YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX, - YOU_MIXED_VECTORS_OF_DIFFERENT_SIZES, - // see StaticAssert.h for all enums. - }; -}; -\endcode - -And then, we define EIGEN_STATIC_ASSERT(CONDITION,MSG) to access Eigen::internal::static_assertion::MSG. If the condition evaluates into \c false, your compiler displays a lot of messages explaining there is no MSG in static_assert. Nevertheless, this is \a not in what we are interested. As you can see, all members of static_assert are ALL_CAPS_AND_THEY_ARE_SHOUTING. - -\warning -When using this macro, MSG should be a member of static_assertion, or the static assertion \b always fails. -Currently, it can only be used in function scope. - -\subsection DerivedStaticAssert Derived static assertions - -There are other macros derived from EIGEN_STATIC_ASSERT to enhance readability. Their names are self-explanatory. - -- \b EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE) - passes if \a TYPE is fixed size. -- \b EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(TYPE) - passes if \a TYPE is dynamic size. -- \b EIGEN_STATIC_ASSERT_LVALUE(Derived) - failes if \a Derived is read-only. -- \b EIGEN_STATIC_ASSERT_ARRAYXPR(Derived) - passes if \a Derived is an array expression. -- EIGEN_STATIC_ASSERT_SAME_XPR_KIND(Derived1, Derived2) - failes if the two expressions are an array one and a matrix one. - -Because Eigen handles both fixed-size and dynamic-size expressions, some conditions cannot be clearly determined at compile time. We classify them into strict assertions and permissive assertions. - -\subsubsection StrictAssertions Strict assertions - -These assertions fail if the condition may not be met. For example, MatrixXd may not be a vector, so it fails EIGEN_STATIC_ASSERT_VECTOR_ONLY. - -- \b EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE) - passes if \a TYPE must be a vector type. -- EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE) - passes if \a TYPE must be a vector of the given size. -- EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(TYPE, ROWS, COLS) - passes if \a TYPE must be a matrix with given rows and columns. - -\subsubsection PermissiveAssertions Permissive assertions - -These assertions fail if the condition \b cannot be met. For example, MatrixXd and Matrix4d may have the same size, so they pass EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE. - -- \b EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TYPE0,TYPE1) - fails if the two vector expression types must have different sizes. -- \b EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0,TYPE1) - fails if the two matrix expression types must have different sizes. -- \b EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE) - fails if \a TYPE cannot be an 1x1 expression. - -See StaticAssert.h for details such as what messages they throw. - -\subsection DisableStaticAssert Disabling static assertions - -If \c EIGEN_NO_STATIC_ASSERT is defined, static assertions turn into eigen_assert's, working like: - -\code -#define EIGEN_STATIC_ASSERT(CONDITION,MSG) eigen_assert((CONDITION) && #MSG); -\endcode - -This saves compile time but consumes more run time. \c EIGEN_NO_STATIC_ASSERT is undefined by default. - -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicEigenExpressionTemplates.dox b/testbed/nanogui/ext/eigen/doc/TopicEigenExpressionTemplates.dox deleted file mode 100644 index b31fd47f..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicEigenExpressionTemplates.dox +++ /dev/null @@ -1,12 +0,0 @@ -namespace Eigen { - -/** \page TopicEigenExpressionTemplates Expression templates in Eigen - - -TODO: write this dox page! - -Is linked from the tutorial on arithmetic ops. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicLazyEvaluation.dox b/testbed/nanogui/ext/eigen/doc/TopicLazyEvaluation.dox deleted file mode 100644 index 393bc41d..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicLazyEvaluation.dox +++ /dev/null @@ -1,65 +0,0 @@ -namespace Eigen { - -/** \page TopicLazyEvaluation Lazy Evaluation and Aliasing - -Executive summary: Eigen has intelligent compile-time mechanisms to enable lazy evaluation and removing temporaries where appropriate. -It will handle aliasing automatically in most cases, for example with matrix products. The automatic behavior can be overridden -manually by using the MatrixBase::eval() and MatrixBase::noalias() methods. - -When you write a line of code involving a complex expression such as - -\code mat1 = mat2 + mat3 * (mat4 + mat5); \endcode - -Eigen determines automatically, for each sub-expression, whether to evaluate it into a temporary variable. Indeed, in certain cases it is better to evaluate immediately a sub-expression into a temporary variable, while in other cases it is better to avoid that. - -A traditional math library without expression templates always evaluates all sub-expressions into temporaries. So with this code, - -\code vec1 = vec2 + vec3; \endcode - -a traditional library would evaluate \c vec2 + vec3 into a temporary \c vec4 and then copy \c vec4 into \c vec1. This is of course inefficient: the arrays are traversed twice, so there are a lot of useless load/store operations. - -Expression-templates-based libraries can avoid evaluating sub-expressions into temporaries, which in many cases results in large speed improvements. This is called lazy evaluation as an expression is getting evaluated as late as possible, instead of immediately. However, most other expression-templates-based libraries always choose lazy evaluation. There are two problems with that: first, lazy evaluation is not always a good choice for performance; second, lazy evaluation can be very dangerous, for example with matrix products: doing matrix = matrix*matrix gives a wrong result if the matrix product is lazy-evaluated, because of the way matrix product works. - -For these reasons, Eigen has intelligent compile-time mechanisms to determine automatically when to use lazy evaluation, and when on the contrary it should evaluate immediately into a temporary variable. - -So in the basic example, - -\code matrix1 = matrix2 + matrix3; \endcode - -Eigen chooses lazy evaluation. Thus the arrays are traversed only once, producing optimized code. If you really want to force immediate evaluation, use \link MatrixBase::eval() eval()\endlink: - -\code matrix1 = (matrix2 + matrix3).eval(); \endcode - -Here is now a more involved example: - -\code matrix1 = -matrix2 + matrix3 + 5 * matrix4; \endcode - -Eigen chooses lazy evaluation at every stage in that example, which is clearly the correct choice. In fact, lazy evaluation is the "default choice" and Eigen will choose it except in a few circumstances. - -The first circumstance in which Eigen chooses immediate evaluation, is when it sees an assignment a = b; and the expression \c b has the evaluate-before-assigning \link flags flag\endlink. The most important example of such an expression is the \link GeneralProduct matrix product expression\endlink. For example, when you do - -\code matrix = matrix * matrix; \endcode - -Eigen first evaluates matrix * matrix into a temporary matrix, and then copies it into the original \c matrix. This guarantees a correct result as we saw above that lazy evaluation gives wrong results with matrix products. It also doesn't cost much, as the cost of the matrix product itself is much higher. - -What if you know that the result does no alias the operand of the product and want to force lazy evaluation? Then use \link MatrixBase::noalias() .noalias()\endlink instead. Here is an example: - -\code matrix1.noalias() = matrix2 * matrix2; \endcode - -Here, since we know that matrix2 is not the same matrix as matrix1, we know that lazy evaluation is not dangerous, so we may force lazy evaluation. Concretely, the effect of noalias() here is to bypass the evaluate-before-assigning \link flags flag\endlink. - -The second circumstance in which Eigen chooses immediate evaluation, is when it sees a nested expression such as a + b where \c b is already an expression having the evaluate-before-nesting \link flags flag\endlink. Again, the most important example of such an expression is the \link GeneralProduct matrix product expression\endlink. For example, when you do - -\code matrix1 = matrix2 + matrix3 * matrix4; \endcode - -the product matrix3 * matrix4 gets evaluated immediately into a temporary matrix. Indeed, experiments showed that it is often beneficial for performance to evaluate immediately matrix products when they are nested into bigger expressions. - -The third circumstance in which Eigen chooses immediate evaluation, is when its cost model shows that the total cost of an operation is reduced if a sub-expression gets evaluated into a temporary. Indeed, in certain cases, an intermediate result is sufficiently costly to compute and is reused sufficiently many times, that is worth "caching". Here is an example: - -\code matrix1 = matrix2 * (matrix3 + matrix4); \endcode - -Here, provided the matrices have at least 2 rows and 2 columns, each coefficienct of the expression matrix3 + matrix4 is going to be used several times in the matrix product. Instead of computing the sum everytime, it is much better to compute it once and store it in a temporary variable. Eigen understands this and evaluates matrix3 + matrix4 into a temporary variable before evaluating the product. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicLinearAlgebraDecompositions.dox b/testbed/nanogui/ext/eigen/doc/TopicLinearAlgebraDecompositions.dox deleted file mode 100644 index 8649cc27..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicLinearAlgebraDecompositions.dox +++ /dev/null @@ -1,261 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TopicLinearAlgebraDecompositions Catalogue of dense decompositions - -This page presents a catalogue of the dense matrix decompositions offered by Eigen. -For an introduction on linear solvers and decompositions, check this \link TutorialLinearAlgebra page \endlink. - -\section TopicLinAlgBigTable Catalogue of decompositions offered by Eigen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Generic information, not Eigen-specificEigen-specific
DecompositionRequirements on the matrixSpeedAlgorithm reliability and accuracyRank-revealingAllows to compute (besides linear solving)Linear solver provided by EigenMaturity of Eigen's implementationOptimizations
PartialPivLUInvertibleFastDepends on condition number--YesExcellentBlocking, Implicit MT
FullPivLU-SlowProvenYes-YesExcellent-
HouseholderQR-FastDepends on condition number-OrthogonalizationYesExcellentBlocking
ColPivHouseholderQR-FastGoodYesOrthogonalizationYesExcellentSoon: blocking
FullPivHouseholderQR-SlowProvenYesOrthogonalizationYesAverage-
LLTPositive definiteVery fastDepends on condition number--YesExcellentBlocking
LDLTPositive or negative semidefinite1Very fastGood--YesExcellentSoon: blocking
\n Singular values and eigenvalues decompositions
JacobiSVD (two-sided)-Slow (but fast for small matrices)Excellent-Proven3YesSingular values/vectors, least squaresYes (and does least squares)ExcellentR-SVD
SelfAdjointEigenSolverSelf-adjointFast-average2GoodYesEigenvalues/vectors-GoodClosed forms for 2x2 and 3x3
ComplexEigenSolverSquareSlow-very slow2Depends on condition numberYesEigenvalues/vectors-Average-
EigenSolverSquare and realAverage-slow2Depends on condition numberYesEigenvalues/vectors-Average-
GeneralizedSelfAdjointEigenSolverSquareFast-average2Depends on condition number-Generalized eigenvalues/vectors-Good-
\n Helper decompositions
RealSchurSquare and realAverage-slow2Depends on condition numberYes--Average-
ComplexSchurSquareSlow-very slow2Depends on condition numberYes--Average-
TridiagonalizationSelf-adjointFastGood---GoodSoon: blocking
HessenbergDecompositionSquareAverageGood---GoodSoon: blocking
- -\b Notes: -
    -
  • \b 1: There exist two variants of the LDLT algorithm. Eigen's one produces a pure diagonal D matrix, and therefore it cannot handle indefinite matrices, unlike Lapack's one which produces a block diagonal D matrix.
  • -
  • \b 2: Eigenvalues, SVD and Schur decompositions rely on iterative algorithms. Their convergence speed depends on how well the eigenvalues are separated.
  • -
  • \b 3: Our JacobiSVD is two-sided, making for proven and optimal precision for square matrices. For non-square matrices, we have to use a QR preconditioner first. The default choice, ColPivHouseholderQR, is already very reliable, but if you want it to be proven, use FullPivHouseholderQR instead. -
- -\section TopicLinAlgTerminology Terminology - -
-
Selfadjoint
-
For a real matrix, selfadjoint is a synonym for symmetric. For a complex matrix, selfadjoint is a synonym for \em hermitian. - More generally, a matrix \f$ A \f$ is selfadjoint if and only if it is equal to its adjoint \f$ A^* \f$. The adjoint is also called the \em conjugate \em transpose.
-
Positive/negative definite
-
A selfadjoint matrix \f$ A \f$ is positive definite if \f$ v^* A v > 0 \f$ for any non zero vector \f$ v \f$. - In the same vein, it is negative definite if \f$ v^* A v < 0 \f$ for any non zero vector \f$ v \f$
-
Positive/negative semidefinite
-
A selfadjoint matrix \f$ A \f$ is positive semi-definite if \f$ v^* A v \ge 0 \f$ for any non zero vector \f$ v \f$. - In the same vein, it is negative semi-definite if \f$ v^* A v \le 0 \f$ for any non zero vector \f$ v \f$
- -
Blocking
-
Means the algorithm can work per block, whence guaranteeing a good scaling of the performance for large matrices.
-
Implicit Multi Threading (MT)
-
Means the algorithm can take advantage of multicore processors via OpenMP. "Implicit" means the algortihm itself is not parallelized, but that it relies on parallelized matrix-matrix product rountines.
-
Explicit Multi Threading (MT)
-
Means the algorithm is explicitely parallelized to take advantage of multicore processors via OpenMP.
-
Meta-unroller
-
Means the algorithm is automatically and explicitly unrolled for very small fixed size matrices.
-
-
-
- -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicMultithreading.dox b/testbed/nanogui/ext/eigen/doc/TopicMultithreading.dox deleted file mode 100644 index f7d08266..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicMultithreading.dox +++ /dev/null @@ -1,46 +0,0 @@ -namespace Eigen { - -/** \page TopicMultiThreading Eigen and multi-threading - -\section TopicMultiThreading_MakingEigenMT Make Eigen run in parallel - -Some Eigen's algorithms can exploit the multiple cores present in your hardware. To this end, it is enough to enable OpenMP on your compiler, for instance: - * GCC: \c -fopenmp - * ICC: \c -openmp - * MSVC: check the respective option in the build properties. -You can control the number of thread that will be used using either the OpenMP API or Eiegn's API using the following priority: -\code - OMP_NUM_THREADS=n ./my_program - omp_set_num_threads(n); - Eigen::setNbThreads(n); -\endcode -Unless setNbThreads has been called, Eigen uses the number of threads specified by OpenMP. You can restore this bahavior by calling \code setNbThreads(0); \endcode -You can query the number of threads that will be used with: -\code -n = Eigen::nbThreads(n); -\endcode -You can disable Eigen's multi threading at compile time by defining the EIGEN_DONT_PARALLELIZE preprocessor token. - -Currently, the following algorithms can make use of multi-threading: - * general matrix - matrix products - * PartialPivLU - -\section TopicMultiThreading_UsingEigenWithMT Using Eigen in a multi-threaded application - -In the case your own application is multithreaded, and multiple threads make calls to Eigen, then you have to initialize Eigen by calling the following routine \b before creating the threads: -\code -#include - -int main(int argc, char** argv) -{ - Eigen::initParallel(); - - ... -} -\endcode - -In the case your application is parallelized with OpenMP, you might want to disable Eigen's own parallization as detailed in the previous section. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicResizing.dox b/testbed/nanogui/ext/eigen/doc/TopicResizing.dox deleted file mode 100644 index c323e17a..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicResizing.dox +++ /dev/null @@ -1,11 +0,0 @@ -namespace Eigen { - -/** \page TopicResizing Resizing - - -TODO: write this dox page! - -Is linked from the tutorial on the Matrix class. - -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicScalarTypes.dox b/testbed/nanogui/ext/eigen/doc/TopicScalarTypes.dox deleted file mode 100644 index 2ff03c19..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicScalarTypes.dox +++ /dev/null @@ -1,12 +0,0 @@ -namespace Eigen { - -/** \page TopicScalarTypes Scalar types - - -TODO: write this dox page! - -Is linked from the tutorial on the Matrix class. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TopicVectorization.dox b/testbed/nanogui/ext/eigen/doc/TopicVectorization.dox deleted file mode 100644 index 274d0451..00000000 --- a/testbed/nanogui/ext/eigen/doc/TopicVectorization.dox +++ /dev/null @@ -1,9 +0,0 @@ -namespace Eigen { - -/** \page TopicVectorization Vectorization - - -TODO: write this dox page! - -*/ -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialAdvancedInitialization.dox b/testbed/nanogui/ext/eigen/doc/TutorialAdvancedInitialization.dox deleted file mode 100644 index 50374d0d..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialAdvancedInitialization.dox +++ /dev/null @@ -1,162 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialAdvancedInitialization Advanced initialization - -This page discusses several advanced methods for initializing matrices. It gives more details on the -comma-initializer, which was introduced before. It also explains how to get special matrices such as the -identity matrix and the zero matrix. - -\eigenAutoToc - -\section TutorialAdvancedInitializationCommaInitializer The comma initializer - -Eigen offers a comma initializer syntax which allows the user to easily set all the coefficients of a matrix, -vector or array. Simply list the coefficients, starting at the top-left corner and moving from left to right -and from the top to the bottom. The size of the object needs to be specified beforehand. If you list too few -or too many coefficients, Eigen will complain. - - - - -
Example:Output:
-\include Tutorial_commainit_01.cpp - -\verbinclude Tutorial_commainit_01.out -
- -Moreover, the elements of the initialization list may themselves be vectors or matrices. A common use is -to join vectors or matrices together. For example, here is how to join two row vectors together. Remember -that you have to set the size before you can use the comma initializer. - - - - -
Example:Output:
-\include Tutorial_AdvancedInitialization_Join.cpp - -\verbinclude Tutorial_AdvancedInitialization_Join.out -
- -We can use the same technique to initialize matrices with a block structure. - - - - -
Example:Output:
-\include Tutorial_AdvancedInitialization_Block.cpp - -\verbinclude Tutorial_AdvancedInitialization_Block.out -
- -The comma initializer can also be used to fill block expressions such as m.row(i). Here is a more -complicated way to get the same result as in the first example above: - - - - -
Example:Output:
-\include Tutorial_commainit_01b.cpp - -\verbinclude Tutorial_commainit_01b.out -
- - -\section TutorialAdvancedInitializationSpecialMatrices Special matrices and arrays - -The Matrix and Array classes have static methods like \link DenseBase::Zero() Zero()\endlink, which can be -used to initialize all coefficients to zero. There are three variants. The first variant takes no arguments -and can only be used for fixed-size objects. If you want to initialize a dynamic-size object to zero, you need -to specify the size. Thus, the second variant requires one argument and can be used for one-dimensional -dynamic-size objects, while the third variant requires two arguments and can be used for two-dimensional -objects. All three variants are illustrated in the following example: - - - - -
Example:Output:
-\include Tutorial_AdvancedInitialization_Zero.cpp - -\verbinclude Tutorial_AdvancedInitialization_Zero.out -
- -Similarly, the static method \link DenseBase::Constant() Constant\endlink(value) sets all coefficients to \c value. -If the size of the object needs to be specified, the additional arguments go before the \c value -argument, as in MatrixXd::Constant(rows, cols, value). The method \link DenseBase::Random() Random() -\endlink fills the matrix or array with random coefficients. The identity matrix can be obtained by calling -\link MatrixBase::Identity() Identity()\endlink; this method is only available for Matrix, not for Array, -because "identity matrix" is a linear algebra concept. The method -\link DenseBase::LinSpaced LinSpaced\endlink(size, low, high) is only available for vectors and -one-dimensional arrays; it yields a vector of the specified size whose coefficients are equally spaced between -\c low and \c high. The method \c LinSpaced() is illustrated in the following example, which prints a table -with angles in degrees, the corresponding angle in radians, and their sine and cosine. - - - - -
Example:Output:
-\include Tutorial_AdvancedInitialization_LinSpaced.cpp - -\verbinclude Tutorial_AdvancedInitialization_LinSpaced.out -
- -This example shows that objects like the ones returned by LinSpaced() can be assigned to variables (and -expressions). Eigen defines utility functions like \link DenseBase::setZero() setZero()\endlink, -\link MatrixBase::setIdentity() \endlink and \link DenseBase::setLinSpaced() \endlink to do this -conveniently. The following example contrasts three ways to construct the matrix -\f$ J = \bigl[ \begin{smallmatrix} O & I \\ I & O \end{smallmatrix} \bigr] \f$: using static methods and -assignment, using static methods and the comma-initializer, or using the setXxx() methods. - - - - -
Example:Output:
-\include Tutorial_AdvancedInitialization_ThreeWays.cpp - -\verbinclude Tutorial_AdvancedInitialization_ThreeWays.out -
- -A summary of all pre-defined matrix, vector and array objects can be found in the \ref QuickRefPage. - - -\section TutorialAdvancedInitializationTemporaryObjects Usage as temporary objects - -As shown above, static methods as Zero() and Constant() can be used to initialize variables at the time of -declaration or at the right-hand side of an assignment operator. You can think of these methods as returning a -matrix or array; in fact, they return so-called \ref TopicEigenExpressionTemplates "expression objects" which -evaluate to a matrix or array when needed, so that this syntax does not incur any overhead. - -These expressions can also be used as a temporary object. The second example in -the \ref GettingStarted guide, which we reproduce here, already illustrates this. - - - - -
Example:Output:
-\include QuickStart_example2_dynamic.cpp - -\verbinclude QuickStart_example2_dynamic.out -
- -The expression m + MatrixXf::Constant(3,3,1.2) constructs the 3-by-3 matrix expression with all its coefficients -equal to 1.2 plus the corresponding coefficient of \a m. - -The comma-initializer, too, can also be used to construct temporary objects. The following example constructs a random -matrix of size 2-by-3, and then multiplies this matrix on the left with -\f$ \bigl[ \begin{smallmatrix} 0 & 1 \\ 1 & 0 \end{smallmatrix} \bigr] \f$. - - - - -
Example:Output:
-\include Tutorial_AdvancedInitialization_CommaTemporary.cpp - -\verbinclude Tutorial_AdvancedInitialization_CommaTemporary.out -
- -The \link CommaInitializer::finished() finished() \endlink method is necessary here to get the actual matrix -object once the comma initialization of our temporary submatrix is done. - - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialArrayClass.dox b/testbed/nanogui/ext/eigen/doc/TutorialArrayClass.dox deleted file mode 100644 index 6432684a..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialArrayClass.dox +++ /dev/null @@ -1,192 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialArrayClass The Array class and coefficient-wise operations - -This page aims to provide an overview and explanations on how to use -Eigen's Array class. - -\eigenAutoToc - -\section TutorialArrayClassIntro What is the Array class? - -The Array class provides general-purpose arrays, as opposed to the Matrix class which -is intended for linear algebra. Furthermore, the Array class provides an easy way to -perform coefficient-wise operations, which might not have a linear algebraic meaning, -such as adding a constant to every coefficient in the array or multiplying two arrays coefficient-wise. - - -\section TutorialArrayClassTypes Array types -Array is a class template taking the same template parameters as Matrix. -As with Matrix, the first three template parameters are mandatory: -\code -Array -\endcode -The last three template parameters are optional. Since this is exactly the same as for Matrix, -we won't explain it again here and just refer to \ref TutorialMatrixClass. - -Eigen also provides typedefs for some common cases, in a way that is similar to the Matrix typedefs -but with some slight differences, as the word "array" is used for both 1-dimensional and 2-dimensional arrays. -We adopt the convention that typedefs of the form ArrayNt stand for 1-dimensional arrays, where N and t are -the size and the scalar type, as in the Matrix typedefs explained on \ref TutorialMatrixClass "this page". For 2-dimensional arrays, we -use typedefs of the form ArrayNNt. Some examples are shown in the following table: - - - - - - - - - - - - - - - - - - - - - - -
Type Typedef
\code Array \endcode \code ArrayXf \endcode
\code Array \endcode \code Array3f \endcode
\code Array \endcode \code ArrayXXd \endcode
\code Array \endcode \code Array33d \endcode
- - -\section TutorialArrayClassAccess Accessing values inside an Array - -The parenthesis operator is overloaded to provide write and read access to the coefficients of an array, just as with matrices. -Furthermore, the \c << operator can be used to initialize arrays (via the comma initializer) or to print them. - - - - -
Example:Output:
-\include Tutorial_ArrayClass_accessors.cpp - -\verbinclude Tutorial_ArrayClass_accessors.out -
- -For more information about the comma initializer, see \ref TutorialAdvancedInitialization. - - -\section TutorialArrayClassAddSub Addition and subtraction - -Adding and subtracting two arrays is the same as for matrices. -The operation is valid if both arrays have the same size, and the addition or subtraction is done coefficient-wise. - -Arrays also support expressions of the form array + scalar which add a scalar to each coefficient in the array. -This provides a functionality that is not directly available for Matrix objects. - - - - -
Example:Output:
-\include Tutorial_ArrayClass_addition.cpp - -\verbinclude Tutorial_ArrayClass_addition.out -
- - -\section TutorialArrayClassMult Array multiplication - -First of all, of course you can multiply an array by a scalar, this works in the same way as matrices. Where arrays -are fundamentally different from matrices, is when you multiply two together. Matrices interpret -multiplication as matrix product and arrays interpret multiplication as coefficient-wise product. Thus, two -arrays can be multiplied if and only if they have the same dimensions. - - - - -
Example:Output:
-\include Tutorial_ArrayClass_mult.cpp - -\verbinclude Tutorial_ArrayClass_mult.out -
- - -\section TutorialArrayClassCwiseOther Other coefficient-wise operations - -The Array class defines other coefficient-wise operations besides the addition, subtraction and multiplication -operators described above. For example, the \link ArrayBase::abs() .abs() \endlink method takes the absolute -value of each coefficient, while \link ArrayBase::sqrt() .sqrt() \endlink computes the square root of the -coefficients. If you have two arrays of the same size, you can call \link ArrayBase::min(const Eigen::ArrayBase&) const .min(.) \endlink to -construct the array whose coefficients are the minimum of the corresponding coefficients of the two given -arrays. These operations are illustrated in the following example. - - - - -
Example:Output:
-\include Tutorial_ArrayClass_cwise_other.cpp - -\verbinclude Tutorial_ArrayClass_cwise_other.out -
- -More coefficient-wise operations can be found in the \ref QuickRefPage. - - -\section TutorialArrayClassConvert Converting between array and matrix expressions - -When should you use objects of the Matrix class and when should you use objects of the Array class? You cannot -apply Matrix operations on arrays, or Array operations on matrices. Thus, if you need to do linear algebraic -operations such as matrix multiplication, then you should use matrices; if you need to do coefficient-wise -operations, then you should use arrays. However, sometimes it is not that simple, but you need to use both -Matrix and Array operations. In that case, you need to convert a matrix to an array or reversely. This gives -access to all operations regardless of the choice of declaring objects as arrays or as matrices. - -\link MatrixBase Matrix expressions \endlink have an \link MatrixBase::array() .array() \endlink method that -'converts' them into \link ArrayBase array expressions\endlink, so that coefficient-wise operations -can be applied easily. Conversely, \link ArrayBase array expressions \endlink -have a \link ArrayBase::matrix() .matrix() \endlink method. As with all Eigen expression abstractions, -this doesn't have any runtime cost (provided that you let your compiler optimize). -Both \link MatrixBase::array() .array() \endlink and \link ArrayBase::matrix() .matrix() \endlink -can be used as rvalues and as lvalues. - -Mixing matrices and arrays in an expression is forbidden with Eigen. For instance, you cannot add a matrix and -array directly; the operands of a \c + operator should either both be matrices or both be arrays. However, -it is easy to convert from one to the other with \link MatrixBase::array() .array() \endlink and -\link ArrayBase::matrix() .matrix()\endlink. The exception to this rule is the assignment operator: it is -allowed to assign a matrix expression to an array variable, or to assign an array expression to a matrix -variable. - -The following example shows how to use array operations on a Matrix object by employing the -\link MatrixBase::array() .array() \endlink method. For example, the statement -result = m.array() * n.array() takes two matrices \c m and \c n, converts them both to an array, uses -* to multiply them coefficient-wise and assigns the result to the matrix variable \c result (this is legal -because Eigen allows assigning array expressions to matrix variables). - -As a matter of fact, this usage case is so common that Eigen provides a \link MatrixBase::cwiseProduct() const -.cwiseProduct(.) \endlink method for matrices to compute the coefficient-wise product. This is also shown in -the example program. - - - - -
Example:Output:
-\include Tutorial_ArrayClass_interop_matrix.cpp - -\verbinclude Tutorial_ArrayClass_interop_matrix.out -
- -Similarly, if \c array1 and \c array2 are arrays, then the expression array1.matrix() * array2.matrix() -computes their matrix product. - -Here is a more advanced example. The expression (m.array() + 4).matrix() * m adds 4 to every -coefficient in the matrix \c m and then computes the matrix product of the result with \c m. Similarly, the -expression (m.array() * n.array()).matrix() * m computes the coefficient-wise product of the matrices -\c m and \c n and then the matrix product of the result with \c m. - - - - -
Example:Output:
-\include Tutorial_ArrayClass_interop.cpp - -\verbinclude Tutorial_ArrayClass_interop.out -
- -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialBlockOperations.dox b/testbed/nanogui/ext/eigen/doc/TutorialBlockOperations.dox deleted file mode 100644 index a2d8c97c..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialBlockOperations.dox +++ /dev/null @@ -1,228 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialBlockOperations Block operations - -This page explains the essentials of block operations. -A block is a rectangular part of a matrix or array. Blocks expressions can be used both -as rvalues and as lvalues. As usual with Eigen expressions, this abstraction has zero runtime cost -provided that you let your compiler optimize. - -\eigenAutoToc - -\section TutorialBlockOperationsUsing Using block operations - -The most general block operation in Eigen is called \link DenseBase::block() .block() \endlink. -There are two versions, whose syntax is as follows: - - - - - - - - -
\b %Block \b operation -Version constructing a \n dynamic-size block expressionVersion constructing a \n fixed-size block expression
%Block of size (p,q), starting at (i,j)\code -matrix.block(i,j,p,q);\endcode \code -matrix.block(i,j);\endcode
- -As always in Eigen, indices start at 0. - -Both versions can be used on fixed-size and dynamic-size matrices and arrays. -These two expressions are semantically equivalent. -The only difference is that the fixed-size version will typically give you faster code if the block size is small, -but requires this size to be known at compile time. - -The following program uses the dynamic-size and fixed-size versions to print the values of several blocks inside a -matrix. - - - - -
Example:Output:
-\include Tutorial_BlockOperations_print_block.cpp - -\verbinclude Tutorial_BlockOperations_print_block.out -
- -In the above example the \link DenseBase::block() .block() \endlink function was employed as a \em rvalue, i.e. -it was only read from. However, blocks can also be used as \em lvalues, meaning that you can assign to a block. - -This is illustrated in the following example. This example also demonstrates blocks in arrays, which works exactly like the above-demonstrated blocks in matrices. - - - - -
Example:Output:
-\include Tutorial_BlockOperations_block_assignment.cpp - -\verbinclude Tutorial_BlockOperations_block_assignment.out -
- -While the \link DenseBase::block() .block() \endlink method can be used for any block operation, there are -other methods for special cases, providing more specialized API and/or better performance. On the topic of performance, all what -matters is that you give Eigen as much information as possible at compile time. For example, if your block is a single whole column in a matrix, -using the specialized \link DenseBase::col() .col() \endlink function described below lets Eigen know that, which can give it optimization opportunities. - -The rest of this page describes these specialized methods. - -\section TutorialBlockOperationsSyntaxColumnRows Columns and rows - -Individual columns and rows are special cases of blocks. Eigen provides methods to easily address them: -\link DenseBase::col() .col() \endlink and \link DenseBase::row() .row()\endlink. - - - - - - - - - - -
%Block operationMethod
ith row - \link DenseBase::row() * \endlink\code -matrix.row(i);\endcode
jth column - \link DenseBase::col() * \endlink\code -matrix.col(j);\endcode
- -The argument for \p col() and \p row() is the index of the column or row to be accessed. As always in Eigen, indices start at 0. - - - - -
Example:Output:
-\include Tutorial_BlockOperations_colrow.cpp - -\verbinclude Tutorial_BlockOperations_colrow.out -
- -That example also demonstrates that block expressions (here columns) can be used in arithmetic like any other expression. - - -\section TutorialBlockOperationsSyntaxCorners Corner-related operations - -Eigen also provides special methods for blocks that are flushed against one of the corners or sides of a -matrix or array. For instance, \link DenseBase::topLeftCorner() .topLeftCorner() \endlink can be used to refer -to a block in the top-left corner of a matrix. - -The different possibilities are summarized in the following table: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%Block \b operation -Version constructing a \n dynamic-size block expressionVersion constructing a \n fixed-size block expression
Top-left p by q block \link DenseBase::topLeftCorner() * \endlink\code -matrix.topLeftCorner(p,q);\endcode \code -matrix.topLeftCorner();\endcode
Bottom-left p by q block - \link DenseBase::bottomLeftCorner() * \endlink\code -matrix.bottomLeftCorner(p,q);\endcode \code -matrix.bottomLeftCorner();\endcode
Top-right p by q block - \link DenseBase::topRightCorner() * \endlink\code -matrix.topRightCorner(p,q);\endcode \code -matrix.topRightCorner();\endcode
Bottom-right p by q block - \link DenseBase::bottomRightCorner() * \endlink\code -matrix.bottomRightCorner(p,q);\endcode \code -matrix.bottomRightCorner();\endcode
%Block containing the first q rows - \link DenseBase::topRows() * \endlink\code -matrix.topRows(q);\endcode \code -matrix.topRows();\endcode
%Block containing the last q rows - \link DenseBase::bottomRows() * \endlink\code -matrix.bottomRows(q);\endcode \code -matrix.bottomRows();\endcode
%Block containing the first p columns - \link DenseBase::leftCols() * \endlink\code -matrix.leftCols(p);\endcode \code -matrix.leftCols

();\endcode

%Block containing the last q columns - \link DenseBase::rightCols() * \endlink\code -matrix.rightCols(q);\endcode \code -matrix.rightCols();\endcode
- -Here is a simple example illustrating the use of the operations presented above: - - - - -
Example:Output:
-\include Tutorial_BlockOperations_corner.cpp - -\verbinclude Tutorial_BlockOperations_corner.out -
- - -\section TutorialBlockOperationsSyntaxVectors Block operations for vectors - -Eigen also provides a set of block operations designed specifically for the special case of vectors and one-dimensional arrays: - - - - - - - - - - - - - - - - - -
%Block operationVersion constructing a \n dynamic-size block expressionVersion constructing a \n fixed-size block expression
%Block containing the first \p n elements - \link DenseBase::head() * \endlink\code -vector.head(n);\endcode \code -vector.head();\endcode
%Block containing the last \p n elements - \link DenseBase::tail() * \endlink\code -vector.tail(n);\endcode \code -vector.tail();\endcode
%Block containing \p n elements, starting at position \p i - \link DenseBase::segment() * \endlink\code -vector.segment(i,n);\endcode \code -vector.segment(i);\endcode
- - -An example is presented below: - - - -
Example:Output:
-\include Tutorial_BlockOperations_vector.cpp - -\verbinclude Tutorial_BlockOperations_vector.out -
- -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialGeometry.dox b/testbed/nanogui/ext/eigen/doc/TutorialGeometry.dox deleted file mode 100644 index 372a275d..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialGeometry.dox +++ /dev/null @@ -1,241 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialGeometry Space transformations - -In this page, we will introduce the many possibilities offered by the \ref Geometry_Module "geometry module" to deal with 2D and 3D rotations and projective or affine transformations. - -\eigenAutoToc - -Eigen's Geometry module provides two different kinds of geometric transformations: - - Abstract transformations, such as rotations (represented by \ref AngleAxis "angle and axis" or by a \ref Quaternion "quaternion"), \ref Translation "translations", \ref Scaling "scalings". These transformations are NOT represented as matrices, but you can nevertheless mix them with matrices and vectors in expressions, and convert them to matrices if you wish. - - Projective or affine transformation matrices: see the Transform class. These are really matrices. - -\note If you are working with OpenGL 4x4 matrices then Affine3f and Affine3d are what you want. Since Eigen defaults to column-major storage, you can directly use the Transform::data() method to pass your transformation matrix to OpenGL. - -You can construct a Transform from an abstract transformation, like this: -\code - Transform t(AngleAxis(angle,axis)); -\endcode -or like this: -\code - Transform t; - t = AngleAxis(angle,axis); -\endcode -But note that unfortunately, because of how C++ works, you can \b not do this: -\code - Transform t = AngleAxis(angle,axis); -\endcode -\b Explanation: In the C++ language, this would require Transform to have a non-explicit conversion constructor from AngleAxis, but we really don't want to allow implicit casting here. - - -\section TutorialGeoElementaryTransformations Transformation types - - - - - - - - - - -
Transformation typeTypical initialization code
-\ref Rotation2D "2D rotation" from an angle\code -Rotation2D rot2(angle_in_radian);\endcode
-3D rotation as an \ref AngleAxis "angle + axis"\code -AngleAxis aa(angle_in_radian, Vector3f(ax,ay,az));\endcode -The axis vector must be normalized.
-3D rotation as a \ref Quaternion "quaternion"\code -Quaternion q; q = AngleAxis(angle_in_radian, axis);\endcode
-N-D Scaling\code -Scaling(sx, sy) -Scaling(sx, sy, sz) -Scaling(s) -Scaling(vecN)\endcode
-N-D Translation\code -Translation(tx, ty) -Translation(tx, ty, tz) -Translation(s) -Translation(vecN)\endcode
-N-D \ref TutorialGeoTransform "Affine transformation"\code -Transform t = concatenation_of_any_transformations; -Transform t = Translation3f(p) * AngleAxisf(a,axis) * Scaling(s);\endcode
-N-D Linear transformations \n -(pure rotations, \n scaling, etc.)\code -Matrix t = concatenation_of_rotations_and_scalings; -Matrix t = Rotation2Df(a) * Scaling(s); -Matrix t = AngleAxisf(a,axis) * Scaling(s);\endcode
- -Notes on rotations\n To transform more than a single vector the preferred -representations are rotation matrices, while for other usages Quaternion is the -representation of choice as they are compact, fast and stable. Finally Rotation2D and -AngleAxis are mainly convenient types to create other rotation objects. - -Notes on Translation and Scaling\n Like AngleAxis, these classes were -designed to simplify the creation/initialization of linear (Matrix) and affine (Transform) -transformations. Nevertheless, unlike AngleAxis which is inefficient to use, these classes -might still be interesting to write generic and efficient algorithms taking as input any -kind of transformations. - -Any of the above transformation types can be converted to any other types of the same nature, -or to a more generic type. Here are some additional examples: - - -
\code -Rotation2Df r; r = Matrix2f(..); // assumes a pure rotation matrix -AngleAxisf aa; aa = Quaternionf(..); -AngleAxisf aa; aa = Matrix3f(..); // assumes a pure rotation matrix -Matrix2f m; m = Rotation2Df(..); -Matrix3f m; m = Quaternionf(..); Matrix3f m; m = Scaling(..); -Affine3f m; m = AngleAxis3f(..); Affine3f m; m = Scaling(..); -Affine3f m; m = Translation3f(..); Affine3f m; m = Matrix3f(..); -\endcode
- - -top\section TutorialGeoCommontransformationAPI Common API across transformation types - -To some extent, Eigen's \ref Geometry_Module "geometry module" allows you to write -generic algorithms working on any kind of transformation representations: - - - - - -
-Concatenation of two transformations\code -gen1 * gen2;\endcode
Apply the transformation to a vector\code -vec2 = gen1 * vec1;\endcode
Get the inverse of the transformation\code -gen2 = gen1.inverse();\endcode
Spherical interpolation \n (Rotation2D and Quaternion only)\code -rot3 = rot1.slerp(alpha,rot2);\endcode
- - - -top\section TutorialGeoTransform Affine transformations -Generic affine transformations are represented by the Transform class which internaly -is a (Dim+1)^2 matrix. In Eigen we have chosen to not distinghish between points and -vectors such that all points are actually represented by displacement vectors from the -origin ( \f$ \mathbf{p} \equiv \mathbf{p}-0 \f$ ). With that in mind, real points and -vector distinguish when the transformation is applied. - - - - - - - -
-Apply the transformation to a \b point \code -VectorNf p1, p2; -p2 = t * p1;\endcode
-Apply the transformation to a \b vector \code -VectorNf vec1, vec2; -vec2 = t.linear() * vec1;\endcode
-Apply a \em general transformation \n to a \b normal \b vector -(explanations)\code -VectorNf n1, n2; -MatrixNf normalMatrix = t.linear().inverse().transpose(); -n2 = (normalMatrix * n1).normalized();\endcode
-Apply a transformation with \em pure \em rotation \n to a \b normal \b vector -(no scaling, no shear)\code -n2 = t.linear() * n1;\endcode
-OpenGL compatibility \b 3D \code -glLoadMatrixf(t.data());\endcode
-OpenGL compatibility \b 2D \code -Affine3f aux(Affine3f::Identity()); -aux.linear().topLeftCorner<2,2>() = t.linear(); -aux.translation().start<2>() = t.translation(); -glLoadMatrixf(aux.data());\endcode
- -\b Component \b accessors - - - - - - -
-full read-write access to the internal matrix\code -t.matrix() = matN1xN1; // N1 means N+1 -matN1xN1 = t.matrix(); -\endcode
-coefficient accessors\code -t(i,j) = scalar; <=> t.matrix()(i,j) = scalar; -scalar = t(i,j); <=> scalar = t.matrix()(i,j); -\endcode
-translation part\code -t.translation() = vecN; -vecN = t.translation(); -\endcode
-linear part\code -t.linear() = matNxN; -matNxN = t.linear(); -\endcode
-extract the rotation matrix\code -matNxN = t.rotation(); -\endcode
- - -\b Transformation \b creation \n -While transformation objects can be created and updated concatenating elementary transformations, -the Transform class also features a procedural API: - - - - - - -
procedural APIequivalent natural API
Translation\code -t.translate(Vector_(tx,ty,..)); -t.pretranslate(Vector_(tx,ty,..)); -\endcode\code -t *= Translation_(tx,ty,..); -t = Translation_(tx,ty,..) * t; -\endcode
\b Rotation \n In 2D and for the procedural API, any_rotation can also \n be an angle in radian\code -t.rotate(any_rotation); -t.prerotate(any_rotation); -\endcode\code -t *= any_rotation; -t = any_rotation * t; -\endcode
Scaling\code -t.scale(Vector_(sx,sy,..)); -t.scale(s); -t.prescale(Vector_(sx,sy,..)); -t.prescale(s); -\endcode\code -t *= Scaling(sx,sy,..); -t *= Scaling(s); -t = Scaling(sx,sy,..) * t; -t = Scaling(s) * t; -\endcode
Shear transformation \n ( \b 2D \b only ! )\code -t.shear(sx,sy); -t.preshear(sx,sy); -\endcode
- -Note that in both API, any many transformations can be concatenated in a single expression as shown in the two following equivalent examples: - - - -
\code -t.pretranslate(..).rotate(..).translate(..).scale(..); -\endcode
\code -t = Translation_(..) * t * RotationType(..) * Translation_(..) * Scaling(..); -\endcode
- - - -top\section TutorialGeoEulerAngles Euler angles - - -
-Euler angles might be convenient to create rotation objects. -On the other hand, since there exist 24 different conventions, they are pretty confusing to use. This example shows how -to create a rotation matrix according to the 2-1-2 convention.\code -Matrix3f m; -m = AngleAxisf(angle1, Vector3f::UnitZ()) -* * AngleAxisf(angle2, Vector3f::UnitY()) -* * AngleAxisf(angle3, Vector3f::UnitZ()); -\endcode
- -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialLinearAlgebra.dox b/testbed/nanogui/ext/eigen/doc/TutorialLinearAlgebra.dox deleted file mode 100644 index b09f3543..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialLinearAlgebra.dox +++ /dev/null @@ -1,255 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialLinearAlgebra Linear algebra and decompositions - -This page explains how to solve linear systems, compute various decompositions such as LU, -QR, %SVD, eigendecompositions... After reading this page, don't miss our -\link TopicLinearAlgebraDecompositions catalogue \endlink of dense matrix decompositions. - -\eigenAutoToc - -\section TutorialLinAlgBasicSolve Basic linear solving - -\b The \b problem: You have a system of equations, that you have written as a single matrix equation - \f[ Ax \: = \: b \f] -Where \a A and \a b are matrices (\a b could be a vector, as a special case). You want to find a solution \a x. - -\b The \b solution: You can choose between various decompositions, depending on what your matrix \a A looks like, -and depending on whether you favor speed or accuracy. However, let's start with an example that works in all cases, -and is a good compromise: - - - - - - -
Example:Output:
\include TutorialLinAlgExSolveColPivHouseholderQR.cpp \verbinclude TutorialLinAlgExSolveColPivHouseholderQR.out
- -In this example, the colPivHouseholderQr() method returns an object of class ColPivHouseholderQR. Since here the -matrix is of type Matrix3f, this line could have been replaced by: -\code -ColPivHouseholderQR dec(A); -Vector3f x = dec.solve(b); -\endcode - -Here, ColPivHouseholderQR is a QR decomposition with column pivoting. It's a good compromise for this tutorial, as it -works for all matrices while being quite fast. Here is a table of some other decompositions that you can choose from, -depending on your matrix and the trade-off you want to make: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DecompositionMethodRequirements on the matrixSpeedAccuracy
PartialPivLUpartialPivLu()Invertible+++
FullPivLUfullPivLu()None-+++
HouseholderQRhouseholderQr()None+++
ColPivHouseholderQRcolPivHouseholderQr()None+++
FullPivHouseholderQRfullPivHouseholderQr()None-+++
LLTllt()Positive definite++++
LDLTldlt()Positive or negative semidefinite+++++
- -All of these decompositions offer a solve() method that works as in the above example. - -For example, if your matrix is positive definite, the above table says that a very good -choice is then the LDLT decomposition. Here's an example, also demonstrating that using a general -matrix (not a vector) as right hand side is possible. - - - - - - - -
Example:Output:
\include TutorialLinAlgExSolveLDLT.cpp \verbinclude TutorialLinAlgExSolveLDLT.out
- -For a \ref TopicLinearAlgebraDecompositions "much more complete table" comparing all decompositions supported by Eigen (notice that Eigen -supports many other decompositions), see our special page on -\ref TopicLinearAlgebraDecompositions "this topic". - -\section TutorialLinAlgSolutionExists Checking if a solution really exists - -Only you know what error margin you want to allow for a solution to be considered valid. -So Eigen lets you do this computation for yourself, if you want to, as in this example: - - - - - - - -
Example:Output:
\include TutorialLinAlgExComputeSolveError.cpp \verbinclude TutorialLinAlgExComputeSolveError.out
- -\section TutorialLinAlgEigensolving Computing eigenvalues and eigenvectors - -You need an eigendecomposition here, see available such decompositions on \ref TopicLinearAlgebraDecompositions "this page". -Make sure to check if your matrix is self-adjoint, as is often the case in these problems. Here's an example using -SelfAdjointEigenSolver, it could easily be adapted to general matrices using EigenSolver or ComplexEigenSolver. - -The computation of eigenvalues and eigenvectors does not necessarily converge, but such failure to converge is -very rare. The call to info() is to check for this possibility. - - - - - - - -
Example:Output:
\include TutorialLinAlgSelfAdjointEigenSolver.cpp \verbinclude TutorialLinAlgSelfAdjointEigenSolver.out
- -\section TutorialLinAlgInverse Computing inverse and determinant - -First of all, make sure that you really want this. While inverse and determinant are fundamental mathematical concepts, -in \em numerical linear algebra they are not as popular as in pure mathematics. Inverse computations are often -advantageously replaced by solve() operations, and the determinant is often \em not a good way of checking if a matrix -is invertible. - -However, for \em very \em small matrices, the above is not true, and inverse and determinant can be very useful. - -While certain decompositions, such as PartialPivLU and FullPivLU, offer inverse() and determinant() methods, you can also -call inverse() and determinant() directly on a matrix. If your matrix is of a very small fixed size (at most 4x4) this -allows Eigen to avoid performing a LU decomposition, and instead use formulas that are more efficient on such small matrices. - -Here is an example: - - - - - - -
Example:Output:
\include TutorialLinAlgInverseDeterminant.cpp \verbinclude TutorialLinAlgInverseDeterminant.out
- -\section TutorialLinAlgLeastsquares Least squares solving - -The best way to do least squares solving is with a SVD decomposition. Eigen provides one as the JacobiSVD class, and its solve() -is doing least-squares solving. - -Here is an example: - - - - - - -
Example:Output:
\include TutorialLinAlgSVDSolve.cpp \verbinclude TutorialLinAlgSVDSolve.out
- -Another way, potentially faster but less reliable, is to use a LDLT decomposition -of the normal matrix. In any case, just read any reference text on least squares, and it will be very easy for you -to implement any linear least squares computation on top of Eigen. - -\section TutorialLinAlgSeparateComputation Separating the computation from the construction - -In the above examples, the decomposition was computed at the same time that the decomposition object was constructed. -There are however situations where you might want to separate these two things, for example if you don't know, -at the time of the construction, the matrix that you will want to decompose; or if you want to reuse an existing -decomposition object. - -What makes this possible is that: -\li all decompositions have a default constructor, -\li all decompositions have a compute(matrix) method that does the computation, and that may be called again - on an already-computed decomposition, reinitializing it. - -For example: - - - - - - - -
Example:Output:
\include TutorialLinAlgComputeTwice.cpp \verbinclude TutorialLinAlgComputeTwice.out
- -Finally, you can tell the decomposition constructor to preallocate storage for decomposing matrices of a given size, -so that when you subsequently decompose such matrices, no dynamic memory allocation is performed (of course, if you -are using fixed-size matrices, no dynamic memory allocation happens at all). This is done by just -passing the size to the decomposition constructor, as in this example: -\code -HouseholderQR qr(50,50); -MatrixXf A = MatrixXf::Random(50,50); -qr.compute(A); // no dynamic memory allocation -\endcode - -\section TutorialLinAlgRankRevealing Rank-revealing decompositions - -Certain decompositions are rank-revealing, i.e. are able to compute the rank of a matrix. These are typically -also the decompositions that behave best in the face of a non-full-rank matrix (which in the square case means a -singular matrix). On \ref TopicLinearAlgebraDecompositions "this table" you can see for all our decompositions -whether they are rank-revealing or not. - -Rank-revealing decompositions offer at least a rank() method. They can also offer convenience methods such as isInvertible(), -and some are also providing methods to compute the kernel (null-space) and image (column-space) of the matrix, as is the -case with FullPivLU: - - - - - - - -
Example:Output:
\include TutorialLinAlgRankRevealing.cpp \verbinclude TutorialLinAlgRankRevealing.out
- -Of course, any rank computation depends on the choice of an arbitrary threshold, since practically no -floating-point matrix is \em exactly rank-deficient. Eigen picks a sensible default threshold, which depends -on the decomposition but is typically the diagonal size times machine epsilon. While this is the best default we -could pick, only you know what is the right threshold for your application. You can set this by calling setThreshold() -on your decomposition object before calling rank() or any other method that needs to use such a threshold. -The decomposition itself, i.e. the compute() method, is independent of the threshold. You don't need to recompute the -decomposition after you've changed the threshold. - - - - - - - -
Example:Output:
\include TutorialLinAlgSetThreshold.cpp \verbinclude TutorialLinAlgSetThreshold.out
- -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialMapClass.dox b/testbed/nanogui/ext/eigen/doc/TutorialMapClass.dox deleted file mode 100644 index f8fb0fd2..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialMapClass.dox +++ /dev/null @@ -1,86 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialMapClass Interfacing with raw buffers: the Map class - -This page explains how to work with "raw" C/C++ arrays. -This can be useful in a variety of contexts, particularly when "importing" vectors and matrices from other libraries into %Eigen. - -\eigenAutoToc - -\section TutorialMapIntroduction Introduction - -Occasionally you may have a pre-defined array of numbers that you want to use within %Eigen as a vector or matrix. While one option is to make a copy of the data, most commonly you probably want to re-use this memory as an %Eigen type. Fortunately, this is very easy with the Map class. - -\section TutorialMapTypes Map types and declaring Map variables - -A Map object has a type defined by its %Eigen equivalent: -\code -Map > -\endcode -Note that, in this default case, a Map requires just a single template parameter. - -To construct a Map variable, you need two other pieces of information: a pointer to the region of memory defining the array of coefficients, and the desired shape of the matrix or vector. For example, to define a matrix of \c float with sizes determined at compile time, you might do the following: -\code -Map mf(pf,rows,columns); -\endcode -where \c pf is a \c float \c * pointing to the array of memory. A fixed-size read-only vector of integers might be declared as -\code -Map mi(pi); -\endcode -where \c pi is an \c int \c *. In this case the size does not have to be passed to the constructor, because it is already specified by the Matrix/Array type. - -Note that Map does not have a default constructor; you \em must pass a pointer to intialize the object. However, you can work around this requirement (see \ref TutorialMapPlacementNew). - -Map is flexible enough to accomodate a variety of different data representations. There are two other (optional) template parameters: -\code -Map -\endcode -\li \c MapOptions specifies whether the pointer is \c #Aligned, or \c #Unaligned. The default is \c #Unaligned. -\li \c StrideType allows you to specify a custom layout for the memory array, using the Stride class. One example would be to specify that the data array is organized in row-major format: - - - - - -
Example:Output:
\include Tutorial_Map_rowmajor.cpp \verbinclude Tutorial_Map_rowmajor.out
-However, Stride is even more flexible than this; for details, see the documentation for the Map and Stride classes. - -\section TutorialMapUsing Using Map variables - -You can use a Map object just like any other %Eigen type: - - - - - -
Example:Output:
\include Tutorial_Map_using.cpp \verbinclude Tutorial_Map_using.out
- -All %Eigen functions are written to accept Map objects just like other %Eigen types. However, when writing your own functions taking %Eigen types, this does \em not happen automatically: a Map type is not identical to its Dense equivalent. See \ref TopicFunctionTakingEigenTypes for details. - -\section TutorialMapPlacementNew Changing the mapped array - -It is possible to change the array of a Map object after declaration, using the C++ "placement new" syntax: - - - - - -
Example:Output:
\include Map_placement_new.cpp \verbinclude Map_placement_new.out
-Despite appearances, this does not invoke the memory allocator, because the syntax specifies the location for storing the result. - -This syntax makes it possible to declare a Map object without first knowing the mapped array's location in memory: -\code -Map A(NULL); // don't try to use this matrix yet! -VectorXf b(n_matrices); -for (int i = 0; i < n_matrices; i++) -{ - new (&A) Map(get_matrix_pointer(i)); - b(i) = A.trace(); -} -\endcode - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialMatrixArithmetic.dox b/testbed/nanogui/ext/eigen/doc/TutorialMatrixArithmetic.dox deleted file mode 100644 index 5fc569a3..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialMatrixArithmetic.dox +++ /dev/null @@ -1,214 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialMatrixArithmetic Matrix and vector arithmetic - -This page aims to provide an overview and some details on how to perform arithmetic -between matrices, vectors and scalars with Eigen. - -\eigenAutoToc - -\section TutorialArithmeticIntroduction Introduction - -Eigen offers matrix/vector arithmetic operations either through overloads of common C++ arithmetic operators such as +, -, *, -or through special methods such as dot(), cross(), etc. -For the Matrix class (matrices and vectors), operators are only overloaded to support -linear-algebraic operations. For example, \c matrix1 \c * \c matrix2 means matrix-matrix product, -and \c vector \c + \c scalar is just not allowed. If you want to perform all kinds of array operations, -not linear algebra, see the \ref TutorialArrayClass "next page". - -\section TutorialArithmeticAddSub Addition and subtraction - -The left hand side and right hand side must, of course, have the same numbers of rows and of columns. They must -also have the same \c Scalar type, as Eigen doesn't do automatic type promotion. The operators at hand here are: -\li binary operator + as in \c a+b -\li binary operator - as in \c a-b -\li unary operator - as in \c -a -\li compound operator += as in \c a+=b -\li compound operator -= as in \c a-=b - - - - -
Example:Output:
-\include tut_arithmetic_add_sub.cpp - -\verbinclude tut_arithmetic_add_sub.out -
- -\section TutorialArithmeticScalarMulDiv Scalar multiplication and division - -Multiplication and division by a scalar is very simple too. The operators at hand here are: -\li binary operator * as in \c matrix*scalar -\li binary operator * as in \c scalar*matrix -\li binary operator / as in \c matrix/scalar -\li compound operator *= as in \c matrix*=scalar -\li compound operator /= as in \c matrix/=scalar - - - - -
Example:Output:
-\include tut_arithmetic_scalar_mul_div.cpp - -\verbinclude tut_arithmetic_scalar_mul_div.out -
- - -\section TutorialArithmeticMentionXprTemplates A note about expression templates - -This is an advanced topic that we explain on \ref TopicEigenExpressionTemplates "this page", -but it is useful to just mention it now. In Eigen, arithmetic operators such as \c operator+ don't -perform any computation by themselves, they just return an "expression object" describing the computation to be -performed. The actual computation happens later, when the whole expression is evaluated, typically in \c operator=. -While this might sound heavy, any modern optimizing compiler is able to optimize away that abstraction and -the result is perfectly optimized code. For example, when you do: -\code -VectorXf a(50), b(50), c(50), d(50); -... -a = 3*b + 4*c + 5*d; -\endcode -Eigen compiles it to just one for loop, so that the arrays are traversed only once. Simplifying (e.g. ignoring -SIMD optimizations), this loop looks like this: -\code -for(int i = 0; i < 50; ++i) - a[i] = 3*b[i] + 4*c[i] + 5*d[i]; -\endcode -Thus, you should not be afraid of using relatively large arithmetic expressions with Eigen: it only gives Eigen -more opportunities for optimization. - -\section TutorialArithmeticTranspose Transposition and conjugation - -The transpose \f$ a^T \f$, conjugate \f$ \bar{a} \f$, and adjoint (i.e., conjugate transpose) \f$ a^* \f$ of a matrix or vector \f$ a \f$ are obtained by the member functions \link DenseBase::transpose() transpose()\endlink, \link MatrixBase::conjugate() conjugate()\endlink, and \link MatrixBase::adjoint() adjoint()\endlink, respectively. - - - - -
Example:Output:
-\include tut_arithmetic_transpose_conjugate.cpp - -\verbinclude tut_arithmetic_transpose_conjugate.out -
- -For real matrices, \c conjugate() is a no-operation, and so \c adjoint() is equivalent to \c transpose(). - -As for basic arithmetic operators, \c transpose() and \c adjoint() simply return a proxy object without doing the actual transposition. If you do b = a.transpose(), then the transpose is evaluated at the same time as the result is written into \c b. However, there is a complication here. If you do a = a.transpose(), then Eigen starts writing the result into \c a before the evaluation of the transpose is finished. Therefore, the instruction a = a.transpose() does not replace \c a with its transpose, as one would expect: - - - -
Example:Output:
-\include tut_arithmetic_transpose_aliasing.cpp - -\verbinclude tut_arithmetic_transpose_aliasing.out -
-This is the so-called \ref TopicAliasing "aliasing issue". In "debug mode", i.e., when \ref TopicAssertions "assertions" have not been disabled, such common pitfalls are automatically detected. - -For \em in-place transposition, as for instance in a = a.transpose(), simply use the \link DenseBase::transposeInPlace() transposeInPlace()\endlink function: - - - -
Example:Output:
-\include tut_arithmetic_transpose_inplace.cpp - -\verbinclude tut_arithmetic_transpose_inplace.out -
-There is also the \link MatrixBase::adjointInPlace() adjointInPlace()\endlink function for complex matrices. - -\section TutorialArithmeticMatrixMul Matrix-matrix and matrix-vector multiplication - -Matrix-matrix multiplication is again done with \c operator*. Since vectors are a special -case of matrices, they are implicitly handled there too, so matrix-vector product is really just a special -case of matrix-matrix product, and so is vector-vector outer product. Thus, all these cases are handled by just -two operators: -\li binary operator * as in \c a*b -\li compound operator *= as in \c a*=b (this multiplies on the right: \c a*=b is equivalent to a = a*b) - - - - -
Example:Output:
-\include tut_arithmetic_matrix_mul.cpp - -\verbinclude tut_arithmetic_matrix_mul.out -
- -Note: if you read the above paragraph on expression templates and are worried that doing \c m=m*m might cause -aliasing issues, be reassured for now: Eigen treats matrix multiplication as a special case and takes care of -introducing a temporary here, so it will compile \c m=m*m as: -\code -tmp = m*m; -m = tmp; -\endcode -If you know your matrix product can be safely evaluated into the destination matrix without aliasing issue, then you can use the \link MatrixBase::noalias() noalias()\endlink function to avoid the temporary, e.g.: -\code -c.noalias() += a * b; -\endcode -For more details on this topic, see the page on \ref TopicAliasing "aliasing". - -\b Note: for BLAS users worried about performance, expressions such as c.noalias() -= 2 * a.adjoint() * b; are fully optimized and trigger a single gemm-like function call. - -\section TutorialArithmeticDotAndCross Dot product and cross product - -For dot product and cross product, you need the \link MatrixBase::dot() dot()\endlink and \link MatrixBase::cross() cross()\endlink methods. Of course, the dot product can also be obtained as a 1x1 matrix as u.adjoint()*v. - - - -
Example:Output:
-\include tut_arithmetic_dot_cross.cpp - -\verbinclude tut_arithmetic_dot_cross.out -
- -Remember that cross product is only for vectors of size 3. Dot product is for vectors of any sizes. -When using complex numbers, Eigen's dot product is conjugate-linear in the first variable and linear in the -second variable. - -\section TutorialArithmeticRedux Basic arithmetic reduction operations -Eigen also provides some reduction operations to reduce a given matrix or vector to a single value such as the sum (computed by \link DenseBase::sum() sum()\endlink), product (\link DenseBase::prod() prod()\endlink), or the maximum (\link DenseBase::maxCoeff() maxCoeff()\endlink) and minimum (\link DenseBase::minCoeff() minCoeff()\endlink) of all its coefficients. - - - - -
Example:Output:
-\include tut_arithmetic_redux_basic.cpp - -\verbinclude tut_arithmetic_redux_basic.out -
- -The \em trace of a matrix, as returned by the function \link MatrixBase::trace() trace()\endlink, is the sum of the diagonal coefficients and can also be computed as efficiently using a.diagonal().sum(), as we will see later on. - -There also exist variants of the \c minCoeff and \c maxCoeff functions returning the coordinates of the respective coefficient via the arguments: - - - - -
Example:Output:
-\include tut_arithmetic_redux_minmax.cpp - -\verbinclude tut_arithmetic_redux_minmax.out -
- - -\section TutorialArithmeticValidity Validity of operations -Eigen checks the validity of the operations that you perform. When possible, -it checks them at compile time, producing compilation errors. These error messages can be long and ugly, -but Eigen writes the important message in UPPERCASE_LETTERS_SO_IT_STANDS_OUT. For example: -\code - Matrix3f m; - Vector4f v; - v = m*v; // Compile-time error: YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES -\endcode - -Of course, in many cases, for example when checking dynamic sizes, the check cannot be performed at compile time. -Eigen then uses runtime assertions. This means that the program will abort with an error message when executing an illegal operation if it is run in "debug mode", and it will probably crash if assertions are turned off. - -\code - MatrixXf m(3,3); - VectorXf v(4); - v = m * v; // Run-time assertion failure here: "invalid matrix product" -\endcode - -For more details on this topic, see \ref TopicAssertions "this page". - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialMatrixClass.dox b/testbed/nanogui/ext/eigen/doc/TutorialMatrixClass.dox deleted file mode 100644 index 7ea0cd78..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialMatrixClass.dox +++ /dev/null @@ -1,265 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialMatrixClass The Matrix class - -\eigenAutoToc - -In Eigen, all matrices and vectors are objects of the Matrix template class. -Vectors are just a special case of matrices, with either 1 row or 1 column. - -\section TutorialMatrixFirst3Params The first three template parameters of Matrix - -The Matrix class takes six template parameters, but for now it's enough to -learn about the first three first parameters. The three remaining parameters have default -values, which for now we will leave untouched, and which we -\ref TutorialMatrixOptTemplParams "discuss below". - -The three mandatory template parameters of Matrix are: -\code -Matrix -\endcode -\li \c Scalar is the scalar type, i.e. the type of the coefficients. - That is, if you want a matrix of floats, choose \c float here. - See \ref TopicScalarTypes "Scalar types" for a list of all supported - scalar types and for how to extend support to new types. -\li \c RowsAtCompileTime and \c ColsAtCompileTime are the number of rows - and columns of the matrix as known at compile time (see - \ref TutorialMatrixDynamic "below" for what to do if the number is not - known at compile time). - -We offer a lot of convenience typedefs to cover the usual cases. For example, \c Matrix4f is -a 4x4 matrix of floats. Here is how it is defined by Eigen: -\code -typedef Matrix Matrix4f; -\endcode -We discuss \ref TutorialMatrixTypedefs "below" these convenience typedefs. - -\section TutorialMatrixVectors Vectors - -As mentioned above, in Eigen, vectors are just a special case of -matrices, with either 1 row or 1 column. The case where they have 1 column is the most common; -such vectors are called column-vectors, often abbreviated as just vectors. In the other case -where they have 1 row, they are called row-vectors. - -For example, the convenience typedef \c Vector3f is a (column) vector of 3 floats. It is defined as follows by Eigen: -\code -typedef Matrix Vector3f; -\endcode -We also offer convenience typedefs for row-vectors, for example: -\code -typedef Matrix RowVector2i; -\endcode - -\section TutorialMatrixDynamic The special value Dynamic - -Of course, Eigen is not limited to matrices whose dimensions are known at compile time. -The \c RowsAtCompileTime and \c ColsAtCompileTime template parameters can take the special -value \c Dynamic which indicates that the size is unknown at compile time, so must -be handled as a run-time variable. In Eigen terminology, such a size is referred to as a -\em dynamic \em size; while a size that is known at compile time is called a -\em fixed \em size. For example, the convenience typedef \c MatrixXd, meaning -a matrix of doubles with dynamic size, is defined as follows: -\code -typedef Matrix MatrixXd; -\endcode -And similarly, we define a self-explanatory typedef \c VectorXi as follows: -\code -typedef Matrix VectorXi; -\endcode -You can perfectly have e.g. a fixed number of rows with a dynamic number of columns, as in: -\code -Matrix -\endcode - -\section TutorialMatrixConstructors Constructors - -A default constructor is always available, never performs any dynamic memory allocation, and never initializes the matrix coefficients. You can do: -\code -Matrix3f a; -MatrixXf b; -\endcode -Here, -\li \c a is a 3-by-3 matrix, with a plain float[9] array of uninitialized coefficients, -\li \c b is a dynamic-size matrix whose size is currently 0-by-0, and whose array of -coefficients hasn't yet been allocated at all. - -Constructors taking sizes are also available. For matrices, the number of rows is always passed first. -For vectors, just pass the vector size. They allocate the array of coefficients -with the given size, but don't initialize the coefficients themselves: -\code -MatrixXf a(10,15); -VectorXf b(30); -\endcode -Here, -\li \c a is a 10x15 dynamic-size matrix, with allocated but currently uninitialized coefficients. -\li \c b is a dynamic-size vector of size 30, with allocated but currently uninitialized coefficients. - -In order to offer a uniform API across fixed-size and dynamic-size matrices, it is legal to use these -constructors on fixed-size matrices, even if passing the sizes is useless in this case. So this is legal: -\code -Matrix3f a(3,3); -\endcode -and is a no-operation. - -Finally, we also offer some constructors to initialize the coefficients of small fixed-size vectors up to size 4: -\code -Vector2d a(5.0, 6.0); -Vector3d b(5.0, 6.0, 7.0); -Vector4d c(5.0, 6.0, 7.0, 8.0); -\endcode - -\section TutorialMatrixCoeffAccessors Coefficient accessors - -The primary coefficient accessors and mutators in Eigen are the overloaded parenthesis operators. -For matrices, the row index is always passed first. For vectors, just pass one index. -The numbering starts at 0. This example is self-explanatory: - - - - -
Example:Output:
-\include tut_matrix_coefficient_accessors.cpp - -\verbinclude tut_matrix_coefficient_accessors.out -
- -Note that the syntax m(index) -is not restricted to vectors, it is also available for general matrices, meaning index-based access -in the array of coefficients. This however depends on the matrix's storage order. All Eigen matrices default to -column-major storage order, but this can be changed to row-major, see \ref TopicStorageOrders "Storage orders". - -The operator[] is also overloaded for index-based access in vectors, but keep in mind that C++ doesn't allow operator[] to -take more than one argument. We restrict operator[] to vectors, because an awkwardness in the C++ language -would make matrix[i,j] compile to the same thing as matrix[j] ! - -\section TutorialMatrixCommaInitializer Comma-initialization - -%Matrix and vector coefficients can be conveniently set using the so-called \em comma-initializer syntax. -For now, it is enough to know this example: - - - - - - -
Example:Output:
\include Tutorial_commainit_01.cpp \verbinclude Tutorial_commainit_01.out
- - -The right-hand side can also contain matrix expressions as discussed in \ref TutorialAdvancedInitialization "this page". - -\section TutorialMatrixSizesResizing Resizing - -The current size of a matrix can be retrieved by \link EigenBase::rows() rows()\endlink, \link EigenBase::cols() cols() \endlink and \link EigenBase::size() size()\endlink. These methods return the number of rows, the number of columns and the number of coefficients, respectively. Resizing a dynamic-size matrix is done by the \link PlainObjectBase::resize(Index,Index) resize() \endlink method. - - - - - - -
Example:Output:
\include tut_matrix_resize.cpp \verbinclude tut_matrix_resize.out
- -The resize() method is a no-operation if the actual matrix size doesn't change; otherwise it is destructive: the values of the coefficients may change. -If you want a conservative variant of resize() which does not change the coefficients, use \link PlainObjectBase::conservativeResize() conservativeResize()\endlink, see \ref TopicResizing "this page" for more details. - -All these methods are still available on fixed-size matrices, for the sake of API uniformity. Of course, you can't actually -resize a fixed-size matrix. Trying to change a fixed size to an actually different value will trigger an assertion failure; -but the following code is legal: - - - - - - -
Example:Output:
\include tut_matrix_resize_fixed_size.cpp \verbinclude tut_matrix_resize_fixed_size.out
- - -\section TutorialMatrixAssignment Assignment and resizing - -Assignment is the action of copying a matrix into another, using \c operator=. Eigen resizes the matrix on the left-hand side automatically so that it matches the size of the matrix on the right-hand size. For example: - - - - - - -
Example:Output:
\include tut_matrix_assignment_resizing.cpp \verbinclude tut_matrix_assignment_resizing.out
- -Of course, if the left-hand side is of fixed size, resizing it is not allowed. - -If you do not want this automatic resizing to happen (for example for debugging purposes), you can disable it, see -\ref TopicResizing "this page". - - -\section TutorialMatrixFixedVsDynamic Fixed vs. Dynamic size - -When should one use fixed sizes (e.g. \c Matrix4f), and when should one prefer dynamic sizes (e.g. \c MatrixXf)? -The simple answer is: use fixed -sizes for very small sizes where you can, and use dynamic sizes for larger sizes or where you have to. For small sizes, -especially for sizes smaller than (roughly) 16, using fixed sizes is hugely beneficial -to performance, as it allows Eigen to avoid dynamic memory allocation and to unroll -loops. Internally, a fixed-size Eigen matrix is just a plain array, i.e. doing -\code Matrix4f mymatrix; \endcode -really amounts to just doing -\code float mymatrix[16]; \endcode -so this really has zero runtime cost. By contrast, the array of a dynamic-size matrix -is always allocated on the heap, so doing -\code MatrixXf mymatrix(rows,columns); \endcode -amounts to doing -\code float *mymatrix = new float[rows*columns]; \endcode -and in addition to that, the MatrixXf object stores its number of rows and columns as -member variables. - -The limitation of using fixed sizes, of course, is that this is only possible -when you know the sizes at compile time. Also, for large enough sizes, say for sizes -greater than (roughly) 32, the performance benefit of using fixed sizes becomes negligible. -Worse, trying to create a very large matrix using fixed sizes inside a function could result in a -stack overflow, since Eigen will try to allocate the array automatically as a local variable, and -this is normally done on the stack. -Finally, depending on circumstances, Eigen can also be more aggressive trying to vectorize -(use SIMD instructions) when dynamic sizes are used, see \ref TopicVectorization "Vectorization". - -\section TutorialMatrixOptTemplParams Optional template parameters - -We mentioned at the beginning of this page that the Matrix class takes six template parameters, -but so far we only discussed the first three. The remaining three parameters are optional. Here is -the complete list of template parameters: -\code -Matrix -\endcode -\li \c Options is a bit field. Here, we discuss only one bit: \c RowMajor. It specifies that the matrices - of this type use row-major storage order; by default, the storage order is column-major. See the page on - \ref TopicStorageOrders "storage orders". For example, this type means row-major 3x3 matrices: - \code - Matrix - \endcode -\li \c MaxRowsAtCompileTime and \c MaxColsAtCompileTime are useful when you want to specify that, even though - the exact sizes of your matrices are not known at compile time, a fixed upper bound is known at - compile time. The biggest reason why you might want to do that is to avoid dynamic memory allocation. - For example the following matrix type uses a plain array of 12 floats, without dynamic memory allocation: - \code - Matrix - \endcode - -\section TutorialMatrixTypedefs Convenience typedefs - -Eigen defines the following Matrix typedefs: -\li MatrixNt for Matrix. For example, MatrixXi for Matrix. -\li VectorNt for Matrix. For example, Vector2f for Matrix. -\li RowVectorNt for Matrix. For example, RowVector3d for Matrix. - -Where: -\li N can be any one of \c 2, \c 3, \c 4, or \c X (meaning \c Dynamic). -\li t can be any one of \c i (meaning int), \c f (meaning float), \c d (meaning double), - \c cf (meaning complex), or \c cd (meaning complex). The fact that typedefs are only - defined for these five types doesn't mean that they are the only supported scalar types. For example, - all standard integer types are supported, see \ref TopicScalarTypes "Scalar types". - - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialReductionsVisitorsBroadcasting.dox b/testbed/nanogui/ext/eigen/doc/TutorialReductionsVisitorsBroadcasting.dox deleted file mode 100644 index 992cf6f3..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialReductionsVisitorsBroadcasting.dox +++ /dev/null @@ -1,257 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialReductionsVisitorsBroadcasting Reductions, visitors and broadcasting - -This page explains Eigen's reductions, visitors and broadcasting and how they are used with -\link MatrixBase matrices \endlink and \link ArrayBase arrays \endlink. - -\eigenAutoToc - -\section TutorialReductionsVisitorsBroadcastingReductions Reductions -In Eigen, a reduction is a function taking a matrix or array, and returning a single -scalar value. One of the most used reductions is \link DenseBase::sum() .sum() \endlink, -returning the sum of all the coefficients inside a given matrix or array. - - - - -
Example:Output:
-\include tut_arithmetic_redux_basic.cpp - -\verbinclude tut_arithmetic_redux_basic.out -
- -The \em trace of a matrix, as returned by the function \c trace(), is the sum of the diagonal coefficients and can equivalently be computed a.diagonal().sum(). - - -\subsection TutorialReductionsVisitorsBroadcastingReductionsNorm Norm computations - -The (Euclidean a.k.a. \f$\ell^2\f$) squared norm of a vector can be obtained \link MatrixBase::squaredNorm() squaredNorm() \endlink. It is equal to the dot product of the vector by itself, and equivalently to the sum of squared absolute values of its coefficients. - -Eigen also provides the \link MatrixBase::norm() norm() \endlink method, which returns the square root of \link MatrixBase::squaredNorm() squaredNorm() \endlink. - -These operations can also operate on matrices; in that case, a n-by-p matrix is seen as a vector of size (n*p), so for example the \link MatrixBase::norm() norm() \endlink method returns the "Frobenius" or "Hilbert-Schmidt" norm. We refrain from speaking of the \f$\ell^2\f$ norm of a matrix because that can mean different things. - -If you want other \f$\ell^p\f$ norms, use the \link MatrixBase::lpNorm() lpNnorm

() \endlink method. The template parameter \a p can take the special value \a Infinity if you want the \f$\ell^\infty\f$ norm, which is the maximum of the absolute values of the coefficients. - -The following example demonstrates these methods. - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.out -
- -\subsection TutorialReductionsVisitorsBroadcastingReductionsBool Boolean reductions - -The following reductions operate on boolean values: - - \link DenseBase::all() all() \endlink returns \b true if all of the coefficients in a given Matrix or Array evaluate to \b true . - - \link DenseBase::any() any() \endlink returns \b true if at least one of the coefficients in a given Matrix or Array evaluates to \b true . - - \link DenseBase::count() count() \endlink returns the number of coefficients in a given Matrix or Array that evaluate to \b true. - -These are typically used in conjunction with the coefficient-wise comparison and equality operators provided by Array. For instance, array > 0 is an %Array of the same size as \c array , with \b true at those positions where the corresponding coefficient of \c array is positive. Thus, (array > 0).all() tests whether all coefficients of \c array are positive. This can be seen in the following example: - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.out -
- -\subsection TutorialReductionsVisitorsBroadcastingReductionsUserdefined User defined reductions - -TODO - -In the meantime you can have a look at the DenseBase::redux() function. - -\section TutorialReductionsVisitorsBroadcastingVisitors Visitors -Visitors are useful when one wants to obtain the location of a coefficient inside -a Matrix or Array. The simplest examples are -\link MatrixBase::maxCoeff() maxCoeff(&x,&y) \endlink and -\link MatrixBase::minCoeff() minCoeff(&x,&y)\endlink, which can be used to find -the location of the greatest or smallest coefficient in a Matrix or -Array. - -The arguments passed to a visitor are pointers to the variables where the -row and column position are to be stored. These variables should be of type -\link DenseBase::Index Index \endlink, as shown below: - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_visitors.out -
- -Note that both functions also return the value of the minimum or maximum coefficient if needed, -as if it was a typical reduction operation. - -\section TutorialReductionsVisitorsBroadcastingPartialReductions Partial reductions -Partial reductions are reductions that can operate column- or row-wise on a Matrix or -Array, applying the reduction operation on each column or row and -returning a column or row-vector with the corresponding values. Partial reductions are applied -with \link DenseBase::colwise() colwise() \endlink or \link DenseBase::rowwise() rowwise() \endlink. - -A simple example is obtaining the maximum of the elements -in each column in a given matrix, storing the result in a row-vector: - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_colwise.out -
- -The same operation can be performed row-wise: - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_rowwise.out -
- -Note that column-wise operations return a 'row-vector' while row-wise operations -return a 'column-vector' - -\subsection TutorialReductionsVisitorsBroadcastingPartialReductionsCombined Combining partial reductions with other operations -It is also possible to use the result of a partial reduction to do further processing. -Here is another example that finds the column whose sum of elements is the maximum - within a matrix. With column-wise partial reductions this can be coded as: - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_maxnorm.out -
- -The previous example applies the \link DenseBase::sum() sum() \endlink reduction on each column -though the \link DenseBase::colwise() colwise() \endlink visitor, obtaining a new matrix whose -size is 1x4. - -Therefore, if -\f[ -\mbox{m} = \begin{bmatrix} 1 & 2 & 6 & 9 \\ - 3 & 1 & 7 & 2 \end{bmatrix} -\f] - -then - -\f[ -\mbox{m.colwise().sum()} = \begin{bmatrix} 4 & 3 & 13 & 11 \end{bmatrix} -\f] - -The \link DenseBase::maxCoeff() maxCoeff() \endlink reduction is finally applied -to obtain the column index where the maximum sum is found, -which is the column index 2 (third column) in this case. - - -\section TutorialReductionsVisitorsBroadcastingBroadcasting Broadcasting -The concept behind broadcasting is similar to partial reductions, with the difference that broadcasting -constructs an expression where a vector (column or row) is interpreted as a matrix by replicating it in -one direction. - -A simple example is to add a certain column-vector to each column in a matrix. -This can be accomplished with: - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.out -
- -We can interpret the instruction mat.colwise() += v in two equivalent ways. It adds the vector \c v -to every column of the matrix. Alternatively, it can be interpreted as repeating the vector \c v four times to -form a four-by-two matrix which is then added to \c mat: -\f[ -\begin{bmatrix} 1 & 2 & 6 & 9 \\ 3 & 1 & 7 & 2 \end{bmatrix} -+ \begin{bmatrix} 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 \end{bmatrix} -= \begin{bmatrix} 1 & 2 & 6 & 9 \\ 4 & 2 & 8 & 3 \end{bmatrix}. -\f] -The operators -=, + and - can also be used column-wise and row-wise. On arrays, we -can also use the operators *=, /=, * and / to perform coefficient-wise -multiplication and division column-wise or row-wise. These operators are not available on matrices because it -is not clear what they would do. If you want multiply column 0 of a matrix \c mat with \c v(0), column 1 with -\c v(1), and so on, then use mat = mat * v.asDiagonal(). - -It is important to point out that the vector to be added column-wise or row-wise must be of type Vector, -and cannot be a Matrix. If this is not met then you will get compile-time error. This also means that -broadcasting operations can only be applied with an object of type Vector, when operating with Matrix. -The same applies for the Array class, where the equivalent for VectorXf is ArrayXf. As always, you should -not mix arrays and matrices in the same expression. - -To perform the same operation row-wise we can do: - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.out -
- -\subsection TutorialReductionsVisitorsBroadcastingBroadcastingCombined Combining broadcasting with other operations -Broadcasting can also be combined with other operations, such as Matrix or Array operations, -reductions and partial reductions. - -Now that broadcasting, reductions and partial reductions have been introduced, we can dive into a more advanced example that finds -the nearest neighbour of a vector v within the columns of matrix m. The Euclidean distance will be used in this example, -computing the squared Euclidean distance with the partial reduction named \link MatrixBase::squaredNorm() squaredNorm() \endlink: - - - - -
Example:Output:
-\include Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp - -\verbinclude Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.out -
- -The line that does the job is -\code - (m.colwise() - v).colwise().squaredNorm().minCoeff(&index); -\endcode - -We will go step by step to understand what is happening: - - - m.colwise() - v is a broadcasting operation, subtracting v from each column in m. The result of this operation -is a new matrix whose size is the same as matrix m: \f[ - \mbox{m.colwise() - v} = - \begin{bmatrix} - -1 & 21 & 4 & 7 \\ - 0 & 8 & 4 & -1 - \end{bmatrix} -\f] - - - (m.colwise() - v).colwise().squaredNorm() is a partial reduction, computing the squared norm column-wise. The result of -this operation is a row-vector where each coefficient is the squared Euclidean distance between each column in m and v: \f[ - \mbox{(m.colwise() - v).colwise().squaredNorm()} = - \begin{bmatrix} - 1 & 505 & 32 & 50 - \end{bmatrix} -\f] - - - Finally, minCoeff(&index) is used to obtain the index of the column in m that is closest to v in terms of Euclidean -distance. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialSparse.dox b/testbed/nanogui/ext/eigen/doc/TutorialSparse.dox deleted file mode 100644 index fa2a3ad8..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialSparse.dox +++ /dev/null @@ -1,341 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TutorialSparse Sparse matrix manipulations - -\eigenAutoToc - -Manipulating and solving sparse problems involves various modules which are summarized below: - - - - - - - - - - -
ModuleHeader fileContents
\link SparseCore_Module SparseCore \endlink\code#include \endcodeSparseMatrix and SparseVector classes, matrix assembly, basic sparse linear algebra (including sparse triangular solvers)
\link SparseCholesky_Module SparseCholesky \endlink\code#include \endcodeDirect sparse LLT and LDLT Cholesky factorization to solve sparse self-adjoint positive definite problems
\link SparseLU_Module SparseLU \endlink\code #include \endcode%Sparse LU factorization to solve general square sparse systems
\link SparseQR_Module SparseQR \endlink\code #include\endcode %Sparse QR factorization for solving sparse linear least-squares problems
\link IterativeLinearSolvers_Module IterativeLinearSolvers \endlink\code#include \endcodeIterative solvers to solve large general linear square problems (including self-adjoint positive definite problems)
\link Sparse_Module Sparse \endlink\code#include \endcodeIncludes all the above modules
- -\section TutorialSparseIntro Sparse matrix format - -In many applications (e.g., finite element methods) it is common to deal with very large matrices where only a few coefficients are different from zero. In such cases, memory consumption can be reduced and performance increased by using a specialized representation storing only the nonzero coefficients. Such a matrix is called a sparse matrix. - -\b The \b %SparseMatrix \b class - -The class SparseMatrix is the main sparse matrix representation of Eigen's sparse module; it offers high performance and low memory usage. -It implements a more versatile variant of the widely-used Compressed Column (or Row) Storage scheme. -It consists of four compact arrays: - - \c Values: stores the coefficient values of the non-zeros. - - \c InnerIndices: stores the row (resp. column) indices of the non-zeros. - - \c OuterStarts: stores for each column (resp. row) the index of the first non-zero in the previous two arrays. - - \c InnerNNZs: stores the number of non-zeros of each column (resp. row). -The word \c inner refers to an \em inner \em vector that is a column for a column-major matrix, or a row for a row-major matrix. -The word \c outer refers to the other direction. - -This storage scheme is better explained on an example. The following matrix - - - - - - -
03 00 0
220 0017
75 01 0
00 00 0
00140 8
- -and one of its possible sparse, \b column \b major representation: - - - -
Values: 227_3514__1_178
InnerIndices: 12_02 4__2_ 14
- - - -
OuterStarts:035810\em 12
InnerNNZs: 2211 2
- -Currently the elements of a given inner vector are guaranteed to be always sorted by increasing inner indices. -The \c "_" indicates available free space to quickly insert new elements. -Assuming no reallocation is needed, the insertion of a random element is therefore in O(nnz_j) where nnz_j is the number of nonzeros of the respective inner vector. -On the other hand, inserting elements with increasing inner indices in a given inner vector is much more efficient since this only requires to increase the respective \c InnerNNZs entry that is a O(1) operation. - -The case where no empty space is available is a special case, and is refered as the \em compressed mode. -It corresponds to the widely used Compressed Column (or Row) Storage schemes (CCS or CRS). -Any SparseMatrix can be turned to this form by calling the SparseMatrix::makeCompressed() function. -In this case, one can remark that the \c InnerNNZs array is redundant with \c OuterStarts because we the equality: \c InnerNNZs[j] = \c OuterStarts[j+1]-\c OuterStarts[j]. -Therefore, in practice a call to SparseMatrix::makeCompressed() frees this buffer. - -It is worth noting that most of our wrappers to external libraries requires compressed matrices as inputs. - -The results of %Eigen's operations always produces \b compressed sparse matrices. -On the other hand, the insertion of a new element into a SparseMatrix converts this later to the \b uncompressed mode. - -Here is the previous matrix represented in compressed mode: - - - -
Values: 22735141178
InnerIndices: 1202 42 14
- - -
OuterStarts:02456\em 8
- -A SparseVector is a special case of a SparseMatrix where only the \c Values and \c InnerIndices arrays are stored. -There is no notion of compressed/uncompressed mode for a SparseVector. - - -\section TutorialSparseExample First example - -Before describing each individual class, let's start with the following typical example: solving the Laplace equation \f$ \nabla u = 0 \f$ on a regular 2D grid using a finite difference scheme and Dirichlet boundary conditions. -Such problem can be mathematically expressed as a linear problem of the form \f$ Ax=b \f$ where \f$ x \f$ is the vector of \c m unknowns (in our case, the values of the pixels), \f$ b \f$ is the right hand side vector resulting from the boundary conditions, and \f$ A \f$ is an \f$ m \times m \f$ matrix containing only a few non-zero elements resulting from the discretization of the Laplacian operator. - - - -
-\include Tutorial_sparse_example.cpp - -\image html Tutorial_sparse_example.jpeg -
- -In this example, we start by defining a column-major sparse matrix type of double \c SparseMatrix, and a triplet list of the same scalar type \c Triplet. A triplet is a simple object representing a non-zero entry as the triplet: \c row index, \c column index, \c value. - -In the main function, we declare a list \c coefficients of triplets (as a std vector) and the right hand side vector \f$ b \f$ which are filled by the \a buildProblem function. -The raw and flat list of non-zero entries is then converted to a true SparseMatrix object \c A. -Note that the elements of the list do not have to be sorted, and possible duplicate entries will be summed up. - -The last step consists of effectively solving the assembled problem. -Since the resulting matrix \c A is symmetric by construction, we can perform a direct Cholesky factorization via the SimplicialLDLT class which behaves like its LDLT counterpart for dense objects. - -The resulting vector \c x contains the pixel values as a 1D array which is saved to a jpeg file shown on the right of the code above. - -Describing the \a buildProblem and \a save functions is out of the scope of this tutorial. They are given \ref TutorialSparse_example_details "here" for the curious and reproducibility purpose. - - - - -\section TutorialSparseSparseMatrix The SparseMatrix class - -\b %Matrix \b and \b vector \b properties \n - -The SparseMatrix and SparseVector classes take three template arguments: - * the scalar type (e.g., double) - * the storage order (ColMajor or RowMajor, the default is ColMajor) - * the inner index type (default is \c int). - -As for dense Matrix objects, constructors takes the size of the object. -Here are some examples: - -\code -SparseMatrix > mat(1000,2000); // declares a 1000x2000 column-major compressed sparse matrix of complex -SparseMatrix mat(1000,2000); // declares a 1000x2000 row-major compressed sparse matrix of double -SparseVector > vec(1000); // declares a column sparse vector of complex of size 1000 -SparseVector vec(1000); // declares a row sparse vector of double of size 1000 -\endcode - -In the rest of the tutorial, \c mat and \c vec represent any sparse-matrix and sparse-vector objects, respectively. - -The dimensions of a matrix can be queried using the following functions: - - - - - - - - - -
Standard \n dimensions\code -mat.rows() -mat.cols()\endcode\code -vec.size() \endcode
Sizes along the \n inner/outer dimensions\code -mat.innerSize() -mat.outerSize()\endcode
Number of non \n zero coefficients\code -mat.nonZeros() \endcode\code -vec.nonZeros() \endcode
- - -\b Iterating \b over \b the \b nonzero \b coefficients \n - -Random access to the elements of a sparse object can be done through the \c coeffRef(i,j) function. -However, this function involves a quite expensive binary search. -In most cases, one only wants to iterate over the non-zeros elements. This is achieved by a standard loop over the outer dimension, and then by iterating over the non-zeros of the current inner vector via an InnerIterator. Thus, the non-zero entries have to be visited in the same order than the storage order. -Here is an example: - - -
-\code -SparseMatrix mat(rows,cols); -for (int k=0; k::InnerIterator it(mat,k); it; ++it) - { - it.value(); - it.row(); // row index - it.col(); // col index (here it is equal to k) - it.index(); // inner index, here it is equal to it.row() - } -\endcode - -\code -SparseVector vec(size); -for (SparseVector::InnerIterator it(vec); it; ++it) -{ - it.value(); // == vec[ it.index() ] - it.index(); -} -\endcode -
-For a writable expression, the referenced value can be modified using the valueRef() function. -If the type of the sparse matrix or vector depends on a template parameter, then the \c typename keyword is -required to indicate that \c InnerIterator denotes a type; see \ref TopicTemplateKeyword for details. - - -\section TutorialSparseFilling Filling a sparse matrix - -Because of the special storage scheme of a SparseMatrix, special care has to be taken when adding new nonzero entries. -For instance, the cost of a single purely random insertion into a SparseMatrix is \c O(nnz), where \c nnz is the current number of non-zero coefficients. - -The simplest way to create a sparse matrix while guaranteeing good performance is thus to first build a list of so-called \em triplets, and then convert it to a SparseMatrix. - -Here is a typical usage example: -\code -typedef Eigen::Triplet T; -std::vector tripletList; -tripletList.reserve(estimation_of_entries); -for(...) -{ - // ... - tripletList.push_back(T(i,j,v_ij)); -} -SparseMatrixType mat(rows,cols); -mat.setFromTriplets(tripletList.begin(), tripletList.end()); -// mat is ready to go! -\endcode -The \c std::vector of triplets might contain the elements in arbitrary order, and might even contain duplicated elements that will be summed up by setFromTriplets(). -See the SparseMatrix::setFromTriplets() function and class Triplet for more details. - - -In some cases, however, slightly higher performance, and lower memory consumption can be reached by directly inserting the non-zeros into the destination matrix. -A typical scenario of this approach is illustrated bellow: -\code -1: SparseMatrix mat(rows,cols); // default is column major -2: mat.reserve(VectorXi::Constant(cols,6)); -3: for each i,j such that v_ij != 0 -4: mat.insert(i,j) = v_ij; // alternative: mat.coeffRef(i,j) += v_ij; -5: mat.makeCompressed(); // optional -\endcode - -- The key ingredient here is the line 2 where we reserve room for 6 non-zeros per column. In many cases, the number of non-zeros per column or row can easily be known in advance. If it varies significantly for each inner vector, then it is possible to specify a reserve size for each inner vector by providing a vector object with an operator[](int j) returning the reserve size of the \c j-th inner vector (e.g., via a VectorXi or std::vector). If only a rought estimate of the number of nonzeros per inner-vector can be obtained, it is highly recommended to overestimate it rather than the opposite. If this line is omitted, then the first insertion of a new element will reserve room for 2 elements per inner vector. -- The line 4 performs a sorted insertion. In this example, the ideal case is when the \c j-th column is not full and contains non-zeros whose inner-indices are smaller than \c i. In this case, this operation boils down to trivial O(1) operation. -- When calling insert(i,j) the element \c i \c ,j must not already exists, otherwise use the coeffRef(i,j) method that will allow to, e.g., accumulate values. This method first performs a binary search and finally calls insert(i,j) if the element does not already exist. It is more flexible than insert() but also more costly. -- The line 5 suppresses the remaining empty space and transforms the matrix into a compressed column storage. - - - -\section TutorialSparseFeatureSet Supported operators and functions - -Because of their special storage format, sparse matrices cannot offer the same level of flexibility than dense matrices. -In Eigen's sparse module we chose to expose only the subset of the dense matrix API which can be efficiently implemented. -In the following \em sm denotes a sparse matrix, \em sv a sparse vector, \em dm a dense matrix, and \em dv a dense vector. - -\subsection TutorialSparse_BasicOps Basic operations - -%Sparse expressions support most of the unary and binary coefficient wise operations: -\code -sm1.real() sm1.imag() -sm1 0.5*sm1 -sm1+sm2 sm1-sm2 sm1.cwiseProduct(sm2) -\endcode -However, a strong restriction is that the storage orders must match. For instance, in the following example: -\code -sm4 = sm1 + sm2 + sm3; -\endcode -sm1, sm2, and sm3 must all be row-major or all column major. -On the other hand, there is no restriction on the target matrix sm4. -For instance, this means that for computing \f$ A^T + A \f$, the matrix \f$ A^T \f$ must be evaluated into a temporary matrix of compatible storage order: -\code -SparseMatrix A, B; -B = SparseMatrix(A.transpose()) + A; -\endcode - -Some binary coefficient-wise operators can also mix sparse and dense expressions: -\code -sm2 = sm1.cwiseProduct(dm1); -dm1 += sm1; -\endcode - -However, it is not yet possible to add a sparse and a dense matrix as in dm2 = sm1 + dm1. -Please write this as the equivalent dm2 = dm1; dm2 += sm1 (we plan to lift this restriction -in the next release of %Eigen). - -%Sparse expressions also support transposition: -\code -sm1 = sm2.transpose(); -sm1 = sm2.adjoint(); -\endcode -However, there is no transposeInPlace() method. - - -\subsection TutorialSparse_Products Matrix products - -%Eigen supports various kind of sparse matrix products which are summarize below: - - \b sparse-dense: - \code -dv2 = sm1 * dv1; -dm2 = dm1 * sm1.adjoint(); -dm2 = 2. * sm1 * dm1; - \endcode - - \b symmetric \b sparse-dense. The product of a sparse symmetric matrix with a dense matrix (or vector) can also be optimized by specifying the symmetry with selfadjointView(): - \code -dm2 = sm1.selfadjointView<>() * dm1; // if all coefficients of A are stored -dm2 = A.selfadjointView() * dm1; // if only the upper part of A is stored -dm2 = A.selfadjointView() * dm1; // if only the lower part of A is stored - \endcode - - \b sparse-sparse. For sparse-sparse products, two different algorithms are available. The default one is conservative and preserve the explicit zeros that might appear: - \code -sm3 = sm1 * sm2; -sm3 = 4 * sm1.adjoint() * sm2; - \endcode - The second algorithm prunes on the fly the explicit zeros, or the values smaller than a given threshold. It is enabled and controlled through the prune() functions: - \code -sm3 = (sm1 * sm2).pruned(); // removes numerical zeros -sm3 = (sm1 * sm2).pruned(ref); // removes elements much smaller than ref -sm3 = (sm1 * sm2).pruned(ref,epsilon); // removes elements smaller than ref*epsilon - \endcode - - - \b permutations. Finally, permutations can be applied to sparse matrices too: - \code -PermutationMatrix P = ...; -sm2 = P * sm1; -sm2 = sm1 * P.inverse(); -sm2 = sm1.transpose() * P; - \endcode - - -\subsection TutorialSparse_TriangularSelfadjoint Triangular and selfadjoint views - -Just as with dense matrices, the triangularView() function can be used to address a triangular part of the matrix, and perform triangular solves with a dense right hand side: -\code -dm2 = sm1.triangularView(dm1); -dv2 = sm1.transpose().triangularView(dv1); -\endcode - -The selfadjointView() function permits various operations: - - optimized sparse-dense matrix products: - \code -dm2 = sm1.selfadjointView<>() * dm1; // if all coefficients of A are stored -dm2 = A.selfadjointView() * dm1; // if only the upper part of A is stored -dm2 = A.selfadjointView() * dm1; // if only the lower part of A is stored - \endcode - - copy of triangular parts: - \code -sm2 = sm1.selfadjointView(); // makes a full selfadjoint matrix from the upper triangular part -sm2.selfadjointView() = sm1.selfadjointView(); // copies the upper triangular part to the lower triangular part - \endcode - - application of symmetric permutations: - \code -PermutationMatrix P = ...; -sm2 = A.selfadjointView().twistedBy(P); // compute P S P' from the upper triangular part of A, and make it a full matrix -sm2.selfadjointView() = A.selfadjointView().twistedBy(P); // compute P S P' from the lower triangular part of A, and then only compute the lower part - \endcode - -Please, refer to the \link SparseQuickRefPage Quick Reference \endlink guide for the list of supported operations. The list of linear solvers available is \link TopicSparseSystems here. \endlink - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/TutorialSparse_example_details.dox b/testbed/nanogui/ext/eigen/doc/TutorialSparse_example_details.dox deleted file mode 100644 index 0438da8b..00000000 --- a/testbed/nanogui/ext/eigen/doc/TutorialSparse_example_details.dox +++ /dev/null @@ -1,4 +0,0 @@ -/** -\page TutorialSparse_example_details -\include Tutorial_sparse_example_details.cpp -*/ diff --git a/testbed/nanogui/ext/eigen/doc/UnalignedArrayAssert.dox b/testbed/nanogui/ext/eigen/doc/UnalignedArrayAssert.dox deleted file mode 100644 index 8c97d787..00000000 --- a/testbed/nanogui/ext/eigen/doc/UnalignedArrayAssert.dox +++ /dev/null @@ -1,114 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TopicUnalignedArrayAssert Explanation of the assertion on unaligned arrays - -Hello! You are seeing this webpage because your program terminated on an assertion failure like this one: -

-my_program: path/to/eigen/Eigen/src/Core/DenseStorage.h:44:
-Eigen::internal::matrix_array::internal::matrix_array()
-[with T = double, int Size = 2, int MatrixOptions = 2, bool Align = true]:
-Assertion `(reinterpret_cast(array) & 0xf) == 0 && "this assertion
-is explained here: http://eigen.tuxfamily.org/dox/UnalignedArrayAssert.html
-**** READ THIS WEB PAGE !!! ****"' failed.
-
- -There are 4 known causes for this issue. Please read on to understand them and learn how to fix them. - -\eigenAutoToc - -\section where Where in my own code is the cause of the problem? - -First of all, you need to find out where in your own code this assertion was triggered from. At first glance, the error message doesn't look helpful, as it refers to a file inside Eigen! However, since your program crashed, if you can reproduce the crash, you can get a backtrace using any debugger. For example, if you're using GCC, you can use the GDB debugger as follows: -\code -$ gdb ./my_program # Start GDB on your program -> run # Start running your program -... # Now reproduce the crash! -> bt # Obtain the backtrace -\endcode -Now that you know precisely where in your own code the problem is happening, read on to understand what you need to change. - -\section c1 Cause 1: Structures having Eigen objects as members - -If you have code like this, - -\code -class Foo -{ - //... - Eigen::Vector2d v; - //... -}; -//... -Foo *foo = new Foo; -\endcode - -then you need to read this separate page: \ref TopicStructHavingEigenMembers "Structures Having Eigen Members". - -Note that here, Eigen::Vector2d is only used as an example, more generally the issue arises for all \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types". - -\section c2 Cause 2: STL Containers - -If you use STL Containers such as std::vector, std::map, ..., with Eigen objects, or with classes containing Eigen objects, like this, - -\code -std::vector my_vector; -struct my_class { ... Eigen::Matrix2f m; ... }; -std::map my_map; -\endcode - -then you need to read this separate page: \ref TopicStlContainers "Using STL Containers with Eigen". - -Note that here, Eigen::Matrix2f is only used as an example, more generally the issue arises for all \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types" and \ref TopicStructHavingEigenMembers "structures having such Eigen objects as member". - -\section c3 Cause 3: Passing Eigen objects by value - -If some function in your code is getting an Eigen object passed by value, like this, - -\code -void func(Eigen::Vector4d v); -\endcode - -then you need to read this separate page: \ref TopicPassingByValue "Passing Eigen objects by value to functions". - -Note that here, Eigen::Vector4d is only used as an example, more generally the issue arises for all \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types". - -\section c4 Cause 4: Compiler making a wrong assumption on stack alignment (for instance GCC on Windows) - -This is a must-read for people using GCC on Windows (like MinGW or TDM-GCC). If you have this assertion failure in an innocent function declaring a local variable like this: - -\code -void foo() -{ - Eigen::Quaternionf q; - //... -} -\endcode - -then you need to read this separate page: \ref TopicWrongStackAlignment "Compiler making a wrong assumption on stack alignment". - -Note that here, Eigen::Quaternionf is only used as an example, more generally the issue arises for all \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types". - -\section explanation General explanation of this assertion - -\ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen objects" must absolutely be created at 16-byte-aligned locations, otherwise SIMD instructions adressing them will crash. - -Eigen normally takes care of these alignment issues for you, by setting an alignment attribute on them and by overloading their "operator new". - -However there are a few corner cases where these alignment settings get overridden: they are the possible causes for this assertion. - -\section getrid I don't care about vectorization, how do I get rid of that stuff? - -Two possibilities: -
    -
  • Define EIGEN_DONT_ALIGN_STATICALLY. That disables all 128-bit static alignment code, while keeping 128-bit heap alignment. This has the effect of - disabling vectorization for fixed-size objects (like Matrix4d) while keeping vectorization of dynamic-size objects - (like MatrixXd). But do note that this breaks ABI compatibility with the default behavior of 128-bit static alignment.
  • -
  • Or define both EIGEN_DONT_VECTORIZE and EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT. This keeps the - 128-bit alignment code and thus preserves ABI compatibility, but completely disables vectorization.
  • -
- -For more information, see this FAQ. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/UsingIntelMKL.dox b/testbed/nanogui/ext/eigen/doc/UsingIntelMKL.dox deleted file mode 100644 index 4b624a15..00000000 --- a/testbed/nanogui/ext/eigen/doc/UsingIntelMKL.dox +++ /dev/null @@ -1,168 +0,0 @@ -/* - Copyright (c) 2011, Intel Corporation. All rights reserved. - Copyright (C) 2011 Gael Guennebaud - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ******************************************************************************** - * Content : Documentation on the use of Intel MKL through Eigen - ******************************************************************************** -*/ - -namespace Eigen { - -/** \page TopicUsingIntelMKL Using Intel® Math Kernel Library from Eigen - -\section TopicUsingIntelMKL_Intro Eigen and Intel® Math Kernel Library (Intel® MKL) - -Since Eigen version 3.1 and later, users can benefit from built-in Intel MKL optimizations with an installed copy of Intel MKL 10.3 (or later). - Intel MKL provides highly optimized multi-threaded mathematical routines for x86-compatible architectures. -Intel MKL is available on Linux, Mac and Windows for both Intel64 and IA32 architectures. - -\warning Be aware that Intel® MKL is a proprietary software. It is the responsibility of the users to buy MKL licenses for their products. Moreover, the license of the user product has to allow linking to proprietary software that excludes any unmodified versions of the GPL. - -Using Intel MKL through Eigen is easy: --# define the \c EIGEN_USE_MKL_ALL macro before including any Eigen's header --# link your program to MKL libraries (see the MKL linking advisor) --# on a 64bits system, you must use the LP64 interface (not the ILP64 one) - -When doing so, a number of Eigen's algorithms are silently substituted with calls to Intel MKL routines. -These substitutions apply only for \b Dynamic \b or \b large enough objects with one of the following four standard scalar types: \c float, \c double, \c complex, and \c complex. -Operations on other scalar types or mixing reals and complexes will continue to use the built-in algorithms. - -In addition you can coarsely select choose which parts will be substituted by defining one or multiple of the following macros: - - - - - - - -
\c EIGEN_USE_BLAS Enables the use of external BLAS level 2 and 3 routines (currently works with Intel MKL only)
\c EIGEN_USE_LAPACKE Enables the use of external Lapack routines via the Intel Lapacke C interface to Lapack (currently works with Intel MKL only)
\c EIGEN_USE_LAPACKE_STRICT Same as \c EIGEN_USE_LAPACKE but algorithm of lower robustness are disabled. This currently concerns only JacobiSVD which otherwise would be replaced by \c gesvd that is less robust than Jacobi rotations.
\c EIGEN_USE_MKL_VML Enables the use of Intel VML (vector operations)
\c EIGEN_USE_MKL_ALL Defines \c EIGEN_USE_BLAS, \c EIGEN_USE_LAPACKE, and \c EIGEN_USE_MKL_VML
- -Finally, the PARDISO sparse solver shipped with Intel MKL can be used through the \ref PardisoLU, \ref PardisoLLT and \ref PardisoLDLT classes of the \ref PardisoSupport_Module. - - -\section TopicUsingIntelMKL_SupportedFeatures List of supported features - -The breadth of Eigen functionality covered by Intel MKL is listed in the table below. - - - - - - - - - - - -
Functional domainCode exampleMKL routines
Matrix-matrix operations \n \c EIGEN_USE_BLAS \code -m1*m2.transpose(); -m1.selfadjointView()*m2; -m1*m2.triangularView(); -m1.selfadjointView().rankUpdate(m2,1.0); -\endcode\code -?gemm -?symm/?hemm -?trmm -dsyrk/ssyrk -\endcode
Matrix-vector operations \n \c EIGEN_USE_BLAS \code -m1.adjoint()*b; -m1.selfadjointView()*b; -m1.triangularView()*b; -\endcode\code -?gemv -?symv/?hemv -?trmv -\endcode
LU decomposition \n \c EIGEN_USE_LAPACKE \n \c EIGEN_USE_LAPACKE_STRICT \code -v1 = m1.lu().solve(v2); -\endcode\code -?getrf -\endcode
Cholesky decomposition \n \c EIGEN_USE_LAPACKE \n \c EIGEN_USE_LAPACKE_STRICT \code -v1 = m2.selfadjointView().llt().solve(v2); -\endcode\code -?potrf -\endcode
QR decomposition \n \c EIGEN_USE_LAPACKE \n \c EIGEN_USE_LAPACKE_STRICT \code -m1.householderQr(); -m1.colPivHouseholderQr(); -\endcode\code -?geqrf -?geqp3 -\endcode
Singular value decomposition \n \c EIGEN_USE_LAPACKE \code -JacobiSVD svd; -svd.compute(m1, ComputeThinV); -\endcode\code -?gesvd -\endcode
Eigen-value decompositions \n \c EIGEN_USE_LAPACKE \n \c EIGEN_USE_LAPACKE_STRICT \code -EigenSolver es(m1); -ComplexEigenSolver ces(m1); -SelfAdjointEigenSolver saes(m1+m1.transpose()); -GeneralizedSelfAdjointEigenSolver - gsaes(m1+m1.transpose(),m2+m2.transpose()); -\endcode\code -?gees -?gees -?syev/?heev -?syev/?heev, -?potrf -\endcode
Schur decomposition \n \c EIGEN_USE_LAPACKE \n \c EIGEN_USE_LAPACKE_STRICT \code -RealSchur schurR(m1); -ComplexSchur schurC(m1); -\endcode\code -?gees -\endcode
Vector Math \n \c EIGEN_USE_MKL_VML \code -v2=v1.array().sin(); -v2=v1.array().asin(); -v2=v1.array().cos(); -v2=v1.array().acos(); -v2=v1.array().tan(); -v2=v1.array().exp(); -v2=v1.array().log(); -v2=v1.array().sqrt(); -v2=v1.array().square(); -v2=v1.array().pow(1.5); -\endcode\code -v?Sin -v?Asin -v?Cos -v?Acos -v?Tan -v?Exp -v?Ln -v?Sqrt -v?Sqr -v?Powx -\endcode
-In the examples, m1 and m2 are dense matrices and v1 and v2 are dense vectors. - - -\section TopicUsingIntelMKL_Links Links -- Intel MKL can be purchased and downloaded here. -- Intel MKL is also bundled with Intel Composer XE. - - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/WrongStackAlignment.dox b/testbed/nanogui/ext/eigen/doc/WrongStackAlignment.dox deleted file mode 100644 index 17d5513a..00000000 --- a/testbed/nanogui/ext/eigen/doc/WrongStackAlignment.dox +++ /dev/null @@ -1,56 +0,0 @@ -namespace Eigen { - -/** \eigenManualPage TopicWrongStackAlignment Compiler making a wrong assumption on stack alignment - -

It appears that this was a GCC bug that has been fixed in GCC 4.5. -If you hit this issue, please upgrade to GCC 4.5 and report to us, so we can update this page.

- -This is an issue that, so far, we met only with GCC on Windows: for instance, MinGW and TDM-GCC. - -By default, in a function like this, - -\code -void foo() -{ - Eigen::Quaternionf q; - //... -} -\endcode - -GCC assumes that the stack is already 16-byte-aligned so that the object \a q will be created at a 16-byte-aligned location. For this reason, it doesn't take any special care to explicitly align the object \a q, as Eigen requires. - -The problem is that, in some particular cases, this assumption can be wrong on Windows, where the stack is only guaranteed to have 4-byte alignment. Indeed, even though GCC takes care of aligning the stack in the main function and does its best to keep it aligned, when a function is called from another thread or from a binary compiled with another compiler, the stack alignment can be corrupted. This results in the object 'q' being created at an unaligned location, making your program crash with the \ref TopicUnalignedArrayAssert "assertion on unaligned arrays". So far we found the three following solutions. - - -\section sec_sol1 Local solution - -A local solution is to mark such a function with this attribute: -\code -__attribute__((force_align_arg_pointer)) void foo() -{ - Eigen::Quaternionf q; - //... -} -\endcode -Read this GCC documentation to understand what this does. Of course this should only be done on GCC on Windows, so for portability you'll have to encapsulate this in a macro which you leave empty on other platforms. The advantage of this solution is that you can finely select which function might have a corrupted stack alignment. Of course on the downside this has to be done for every such function, so you may prefer one of the following two global solutions. - - -\section sec_sol2 Global solutions - -A global solution is to edit your project so that when compiling with GCC on Windows, you pass this option to GCC: -\code --mincoming-stack-boundary=2 -\endcode -Explanation: this tells GCC that the stack is only required to be aligned to 2^2=4 bytes, so that GCC now knows that it really must take extra care to honor the 16 byte alignment of \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types" when needed. - -Another global solution is to pass this option to gcc: -\code --mstackrealign -\endcode -which has the same effect than adding the \c force_align_arg_pointer attribute to all functions. - -These global solutions are easy to use, but note that they may slowdown your program because they lead to extra prologue/epilogue instructions for every function. - -*/ - -} diff --git a/testbed/nanogui/ext/eigen/doc/eigen_navtree_hacks.js b/testbed/nanogui/ext/eigen/doc/eigen_navtree_hacks.js deleted file mode 100644 index bd7e02b3..00000000 --- a/testbed/nanogui/ext/eigen/doc/eigen_navtree_hacks.js +++ /dev/null @@ -1,240 +0,0 @@ - -// generate a table of contents in the side-nav based on the h1/h2 tags of the current page. -function generate_autotoc() { - var headers = $("h1, h2"); - if(headers.length > 1) { - var toc = $("#side-nav").append(''); - toc = $("#nav-toc"); - var footerHeight = footer.height(); - toc = toc.append('
    '); - toc = toc.find('ul'); - var indices = new Array(); - indices[0] = 0; - indices[1] = 0; - - var h1counts = $("h1").length; - headers.each(function(i) { - var current = $(this); - var levelTag = current[0].tagName.charAt(1); - if(h1counts==0) - levelTag--; - var cur_id = current.attr("id"); - - indices[levelTag-1]+=1; - var prefix = indices[0]; - if (levelTag >1) { - prefix+="."+indices[1]; - } - - // Uncomment to add number prefixes - // current.html(prefix + " " + current.html()); - for(var l = levelTag; l < 2; ++l){ - indices[l] = 0; - } - - if(cur_id == undefined) { - current.attr('id', 'title' + i); - current.addClass('anchor'); - toc.append("
  • " + current.text() + "
  • "); - } else { - toc.append("
  • " + current.text() + "
  • "); - } - }); - resizeHeight(); - } -} - - -var global_navtree_object; - -// Overloaded to remove links to sections/subsections -function getNode(o, po) -{ - po.childrenVisited = true; - var l = po.childrenData.length-1; - for (var i in po.childrenData) { - var nodeData = po.childrenData[i]; - if((!nodeData[1]) || (nodeData[1].indexOf('#')==-1)) // <- we added this line - po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2], i==l); - } -} - -// Overloaded to adjust the size of the navtree wrt the toc -function resizeHeight() -{ - var toc = $("#nav-toc"); - var tocHeight = toc.height(); // <- we added this line - var headerHeight = header.height(); - var footerHeight = footer.height(); - var windowHeight = $(window).height() - headerHeight - footerHeight; - content.css({height:windowHeight + "px"}); - navtree.css({height:(windowHeight-tocHeight) + "px"}); // <- we modified this line - sidenav.css({height:(windowHeight) + "px",top: headerHeight+"px"}); -} - -// Overloaded to save the root node into global_navtree_object -function initNavTree(toroot,relpath) -{ - var o = new Object(); - global_navtree_object = o; // <- we added this line - o.toroot = toroot; - o.node = new Object(); - o.node.li = document.getElementById("nav-tree-contents"); - o.node.childrenData = NAVTREE; - o.node.children = new Array(); - o.node.childrenUL = document.createElement("ul"); - o.node.getChildrenUL = function() { return o.node.childrenUL; }; - o.node.li.appendChild(o.node.childrenUL); - o.node.depth = 0; - o.node.relpath = relpath; - o.node.expanded = false; - o.node.isLast = true; - o.node.plus_img = document.createElement("img"); - o.node.plus_img.src = relpath+"ftv2pnode.png"; - o.node.plus_img.width = 16; - o.node.plus_img.height = 22; - - if (localStorageSupported()) { - var navSync = $('#nav-sync'); - if (cachedLink()) { - showSyncOff(navSync,relpath); - navSync.removeClass('sync'); - } else { - showSyncOn(navSync,relpath); - } - navSync.click(function(){ toggleSyncButton(relpath); }); - } - - navTo(o,toroot,window.location.hash,relpath); - - $(window).bind('hashchange', function(){ - if (window.location.hash && window.location.hash.length>1){ - var a; - if ($(location).attr('hash')){ - var clslink=stripPath($(location).attr('pathname'))+':'+ - $(location).attr('hash').substring(1); - a=$('.item a[class$="'+clslink+'"]'); - } - if (a==null || !$(a).parent().parent().hasClass('selected')){ - $('.item').removeClass('selected'); - $('.item').removeAttr('id'); - } - var link=stripPath2($(location).attr('pathname')); - navTo(o,link,$(location).attr('hash'),relpath); - } else if (!animationInProgress) { - $('#doc-content').scrollTop(0); - $('.item').removeClass('selected'); - $('.item').removeAttr('id'); - navTo(o,toroot,window.location.hash,relpath); - } - }) - - $(window).load(showRoot); -} - -// return false if the the node has no children at all, or has only section/subsection children -function checkChildrenData(node) { - if (!(typeof(node.childrenData)==='string')) { - for (var i in node.childrenData) { - var url = node.childrenData[i][1]; - if(url.indexOf("#")==-1) - return true; - } - return false; - } - return (node.childrenData); -} - -// Modified to: -// 1 - remove the root node -// 2 - remove the section/subsection children -function createIndent(o,domNode,node,level) -{ - var level=-2; // <- we replaced level=-1 by level=-2 - var n = node; - while (n.parentNode) { level++; n=n.parentNode; } - var imgNode = document.createElement("img"); - imgNode.style.paddingLeft=(16*(level)).toString()+'px'; - imgNode.width = 16; - imgNode.height = 22; - imgNode.border = 0; - if (checkChildrenData(node)) { // <- we modified this line to use checkChildrenData(node) instead of node.childrenData - node.plus_img = imgNode; - node.expandToggle = document.createElement("a"); - node.expandToggle.href = "javascript:void(0)"; - node.expandToggle.onclick = function() { - if (node.expanded) { - $(node.getChildrenUL()).slideUp("fast"); - node.plus_img.src = node.relpath+"ftv2pnode.png"; - node.expanded = false; - } else { - expandNode(o, node, false, false); - } - } - node.expandToggle.appendChild(imgNode); - domNode.appendChild(node.expandToggle); - imgNode.src = node.relpath+"ftv2pnode.png"; - } else { - imgNode.src = node.relpath+"ftv2node.png"; - domNode.appendChild(imgNode); - } -} - -// Overloaded to automatically expand the selected node -function selectAndHighlight(hash,n) -{ - var a; - if (hash) { - var link=stripPath($(location).attr('pathname'))+':'+hash.substring(1); - a=$('.item a[class$="'+link+'"]'); - } - if (a && a.length) { - a.parent().parent().addClass('selected'); - a.parent().parent().attr('id','selected'); - highlightAnchor(); - } else if (n) { - $(n.itemDiv).addClass('selected'); - $(n.itemDiv).attr('id','selected'); - } - if ($('#nav-tree-contents .item:first').hasClass('selected')) { - $('#nav-sync').css('top','30px'); - } else { - $('#nav-sync').css('top','5px'); - } - expandNode(global_navtree_object, n, true, true); // <- we added this line - showRoot(); -} - - -$(document).ready(function() { - - generate_autotoc(); - - (function (){ // wait until the first "selected" element has been created - try { - - // this line will triger an exception if there is no #selected element, i.e., before the tree structure is complete. - document.getElementById("selected").className = "item selected"; - - // ok, the default tree has been created, we can keep going... - - // expand the "Chapters" node - if(window.location.href.indexOf('unsupported')==-1) - expandNode(global_navtree_object, global_navtree_object.node.children[0].children[2], true, true); - else - expandNode(global_navtree_object, global_navtree_object.node.children[0].children[1], true, true); - - // Hide the root node "Eigen" - $(document.getElementsByClassName('index.html')[0]).parent().parent().css({display:"none"}); - - } catch (err) { - setTimeout(arguments.callee, 10); - } - })(); -}); - -$(window).load(function() { - resizeHeight(); -}); diff --git a/testbed/nanogui/ext/eigen/doc/eigendoxy.css b/testbed/nanogui/ext/eigen/doc/eigendoxy.css deleted file mode 100644 index efaeb46d..00000000 --- a/testbed/nanogui/ext/eigen/doc/eigendoxy.css +++ /dev/null @@ -1,211 +0,0 @@ - -/******** Eigen specific CSS code ************/ - -/**** Styles removing elements ****/ - -/* remove the "modules|classes" link for module pages (they are already in the TOC) */ -div.summary { - display:none; -} - -/* remove */ -div.contents hr { - display:none; -} - -/**** ****/ - -p, dl.warning, dl.attention, dl.note -{ - max-width:60em; - text-align:justify; -} - -li { - max-width:55em; - text-align:justify; -} - -img { - border: 0; -} - -div.fragment { - display:table; /* this allows the element to be larger than its parent */ - padding: 0pt; -} -pre.fragment { - border: 1px solid #cccccc; - - margin: 2px 0px 2px 0px; - padding: 3px 5px 3px 5px; -} - - - -/* Common style for all Eigen's tables */ - -table.example, table.manual, table.manual-vl { - max-width:100%; - border-collapse: collapse; - border-style: solid; - border-width: 1px; - border-color: #cccccc; - font-size: 1em; - - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -moz-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -} - -table.example th, table.manual th, table.manual-vl th { - padding: 0.5em 0.5em 0.5em 0.5em; - text-align: left; - padding-right: 1em; - color: #555555; - background-color: #F4F4E5; - - background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.3,#FFFFFF), color-stop(0.30,#FFFFFF), color-stop(0.98,#F4F4E5), to(#ECECDE)); - background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 30%, #F4F4E5 98%, #ECECDE); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#F4F4E5'); -} - -table.example td, table.manual td, table.manual-vl td { - vertical-align:top; - border-width: 1px; - border-color: #cccccc; -} - -/* header of headers */ -table th.meta { - text-align:center; - font-size: 1.2em; - background-color:#FFFFFF; -} - -/* intermediate header */ -table th.inter { - text-align:left; - background-color:#FFFFFF; - background-image:none; - border-style:solid solid solid solid; - border-width: 1px; - border-color: #cccccc; -} - -/** class for exemple / output tables **/ - -table.example { -} - -table.example th { -} - -table.example td { - padding: 0.5em 0.5em 0.5em 0.5em; - vertical-align:top; -} - -/* standard class for the manual */ - -table.manual, table.manual-vl { - padding: 0.2em 0em 0.5em 0em; -} - -table.manual th, table.manual-vl th { - margin: 0em 0em 0.3em 0em; -} - -table.manual td, table.manual-vl td { - padding: 0.3em 0.5em 0.3em 0.5em; - vertical-align:top; - border-width: 1px; -} - -table.manual td.alt, table.manual tr.alt, table.manual-vl td.alt, table.manual-vl tr.alt { - background-color: #F4F4E5; -} - -table.manual-vl th, table.manual-vl td, table.manual-vl td.alt { - border-color: #cccccc; - border-width: 1px; - border-style: none solid none solid; -} - -table.manual-vl th.inter { - border-style: solid solid solid solid; -} - -h2 { - margin-top:2em; - border-style: none none solid none; - border-width: 1px; - border-color: #cccccc; -} - -/**** Table of content in the side-nav ****/ - - -div.toc { - margin:0; - padding: 0.3em 0 0 0; - width:100%; - float:none; - position:absolute; - bottom:0; - border-radius:0px; - border-style: solid none none none; -} - -div.toc h3 { - margin-left: 0.5em; - margin-bottom: 0.2em; -} - -div.toc ul { - margin: 0.2em 0 0.4em 0.5em; -} - -/**** old Eigen's styles ****/ - - -table.tutorial_code td { - border-color: transparent; /* required for Firefox */ - padding: 3pt 5pt 3pt 5pt; - vertical-align: top; -} - - -/* Whenever doxygen meets a '\n' or a '
    ', it will put - * the text containing the characted into a

    . - * This little hack togehter with table.tutorial_code td.note - * aims at fixing this issue. */ -table.tutorial_code td.note p.starttd { - margin: 0px; - border: none; - padding: 0px; -} - -div.eimainmenu { - text-align: center; -} - -/* center version number on main page */ -h3.version { - text-align: center; -} - - -td.width20em p.endtd { - width: 20em; -} - -.bigwarning { - font-size:2em; - font-weight:bold; - margin:1em; - padding:1em; - color:red; - border:solid; -} - diff --git a/testbed/nanogui/ext/eigen/doc/eigendoxy_footer.html.in b/testbed/nanogui/ext/eigen/doc/eigendoxy_footer.html.in deleted file mode 100644 index 878244a1..00000000 --- a/testbed/nanogui/ext/eigen/doc/eigendoxy_footer.html.in +++ /dev/null @@ -1,36 +0,0 @@ - - -

    - - - - - - - - - - - - - diff --git a/testbed/nanogui/ext/eigen/doc/eigendoxy_header.html.in b/testbed/nanogui/ext/eigen/doc/eigendoxy_header.html.in deleted file mode 100644 index 0f3859f4..00000000 --- a/testbed/nanogui/ext/eigen/doc/eigendoxy_header.html.in +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - -$projectname: $title -$title - - - -$treeview -$search -$mathjax - - - - - - - - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    -
    $projectname -  $projectnumber -
    -
    $projectbrief
    -
    -
    $projectbrief
    -
    $searchbox
    -
    - - - diff --git a/testbed/nanogui/ext/eigen/doc/eigendoxy_layout.xml.in b/testbed/nanogui/ext/eigen/doc/eigendoxy_layout.xml.in deleted file mode 100644 index c14b621e..00000000 --- a/testbed/nanogui/ext/eigen/doc/eigendoxy_layout.xml.in +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testbed/nanogui/ext/eigen/doc/eigendoxy_tabs.css b/testbed/nanogui/ext/eigen/doc/eigendoxy_tabs.css deleted file mode 100644 index 21920562..00000000 --- a/testbed/nanogui/ext/eigen/doc/eigendoxy_tabs.css +++ /dev/null @@ -1,59 +0,0 @@ -.tabs, .tabs2, .tabs3 { - background-image: url('tab_b.png'); - width: 100%; - z-index: 101; - font-size: 13px; -} - -.tabs2 { - font-size: 10px; -} -.tabs3 { - font-size: 9px; -} - -.tablist { - margin: 0; - padding: 0; - display: table; -} - -.tablist li { - float: left; - display: table-cell; - background-image: url('tab_b.png'); - line-height: 36px; - list-style: none; -} - -.tablist a { - display: block; - padding: 0 20px; - font-weight: bold; - background-image:url('tab_s.png'); - background-repeat:no-repeat; - background-position:right; - color: #283A5D; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; - outline: none; -} - -.tabs3 .tablist a { - padding: 0 10px; -} - -.tablist a:hover { - background-image: url('tab_h.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); - text-decoration: none; -} - -.tablist li.current a { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/.krazy b/testbed/nanogui/ext/eigen/doc/examples/.krazy deleted file mode 100644 index 00b99405..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/.krazy +++ /dev/null @@ -1,2 +0,0 @@ -EXCLUDE copyright -EXCLUDE license diff --git a/testbed/nanogui/ext/eigen/doc/examples/CMakeLists.txt b/testbed/nanogui/ext/eigen/doc/examples/CMakeLists.txt deleted file mode 100644 index 08cf8efd..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -file(GLOB examples_SRCS "*.cpp") - -foreach(example_src ${examples_SRCS}) - get_filename_component(example ${example_src} NAME_WE) - add_executable(${example} ${example_src}) - if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) - target_link_libraries(${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) - endif() - add_custom_command( - TARGET ${example} - POST_BUILD - COMMAND ${example} - ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out - ) - add_dependencies(all_examples ${example}) -endforeach(example_src) diff --git a/testbed/nanogui/ext/eigen/doc/examples/DenseBase_middleCols_int.cpp b/testbed/nanogui/ext/eigen/doc/examples/DenseBase_middleCols_int.cpp deleted file mode 100644 index 0ebd955e..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/DenseBase_middleCols_int.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main(void) -{ - int const N = 5; - MatrixXi A(N,N); - A.setRandom(); - cout << "A =\n" << A << '\n' << endl; - cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/DenseBase_middleRows_int.cpp b/testbed/nanogui/ext/eigen/doc/examples/DenseBase_middleRows_int.cpp deleted file mode 100644 index a6fe9e84..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/DenseBase_middleRows_int.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main(void) -{ - int const N = 5; - MatrixXi A(N,N); - A.setRandom(); - cout << "A =\n" << A << '\n' << endl; - cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleCols.cpp b/testbed/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleCols.cpp deleted file mode 100644 index 6191d79c..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleCols.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main(void) -{ - int const N = 5; - MatrixXi A(N,N); - A.setRandom(); - cout << "A =\n" << A << '\n' << endl; - cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleRows.cpp b/testbed/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleRows.cpp deleted file mode 100644 index 7e8b6573..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleRows.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main(void) -{ - int const N = 5; - MatrixXi A(N,N); - A.setRandom(); - cout << "A =\n" << A << '\n' << endl; - cout << "A(1..3,:) =\n" << A.middleRows<3>(1) << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/MatrixBase_cwise_const.cpp b/testbed/nanogui/ext/eigen/doc/examples/MatrixBase_cwise_const.cpp deleted file mode 100644 index 23700e0b..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/MatrixBase_cwise_const.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#define EIGEN2_SUPPORT -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - Matrix3i m = Matrix3i::Random(); - cout << "Here is the matrix m:" << endl << m << endl; - Matrix3i n = Matrix3i::Random(); - cout << "And here is the matrix n:" << endl << n << endl; - cout << "The coefficient-wise product of m and n is:" << endl; - cout << m.cwise() * n << endl; - cout << "Taking the cube of the coefficients of m yields:" << endl; - cout << m.cwise().pow(3) << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example.cpp b/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example.cpp deleted file mode 100644 index 7238c0c4..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -using Eigen::MatrixXd; - -int main() -{ - MatrixXd m(2,2); - m(0,0) = 3; - m(1,0) = 2.5; - m(0,1) = -1; - m(1,1) = m(1,0) + m(0,1); - std::cout << m << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example2_dynamic.cpp b/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example2_dynamic.cpp deleted file mode 100644 index ff6746e2..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example2_dynamic.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - MatrixXd m = MatrixXd::Random(3,3); - m = (m + MatrixXd::Constant(3,3,1.2)) * 50; - cout << "m =" << endl << m << endl; - VectorXd v(3); - v << 1, 2, 3; - cout << "m * v =" << endl << m * v << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example2_fixed.cpp b/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example2_fixed.cpp deleted file mode 100644 index d9117527..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/QuickStart_example2_fixed.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - Matrix3d m = Matrix3d::Random(); - m = (m + Matrix3d::Constant(1.2)) * 50; - cout << "m =" << endl << m << endl; - Vector3d v(1,2,3); - - cout << "m * v =" << endl << m * v << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TemplateKeyword_flexible.cpp b/testbed/nanogui/ext/eigen/doc/examples/TemplateKeyword_flexible.cpp deleted file mode 100644 index 9d85292d..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TemplateKeyword_flexible.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -using namespace Eigen; - -template -void copyUpperTriangularPart(MatrixBase& dst, const MatrixBase& src) -{ - /* Note the 'template' keywords in the following line! */ - dst.template triangularView() = src.template triangularView(); -} - -int main() -{ - MatrixXi m1 = MatrixXi::Ones(5,5); - MatrixXi m2 = MatrixXi::Random(4,4); - std::cout << "m2 before copy:" << std::endl; - std::cout << m2 << std::endl << std::endl; - copyUpperTriangularPart(m2, m1.topLeftCorner(4,4)); - std::cout << "m2 after copy:" << std::endl; - std::cout << m2 << std::endl << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TemplateKeyword_simple.cpp b/testbed/nanogui/ext/eigen/doc/examples/TemplateKeyword_simple.cpp deleted file mode 100644 index 6998c176..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TemplateKeyword_simple.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -using namespace Eigen; - -void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src) -{ - dst.triangularView() = src.triangularView(); -} - -int main() -{ - MatrixXf m1 = MatrixXf::Ones(4,4); - MatrixXf m2 = MatrixXf::Random(4,4); - std::cout << "m2 before copy:" << std::endl; - std::cout << m2 << std::endl << std::endl; - copyUpperTriangularPart(m2, m1); - std::cout << "m2 after copy:" << std::endl; - std::cout << m2 << std::endl << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgComputeTwice.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgComputeTwice.cpp deleted file mode 100644 index 06ba6461..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgComputeTwice.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Matrix2f A, b; - LLT llt; - A << 2, -1, -1, 3; - b << 1, 2, 3, 1; - cout << "Here is the matrix A:\n" << A << endl; - cout << "Here is the right hand side b:\n" << b << endl; - cout << "Computing LLT decomposition..." << endl; - llt.compute(A); - cout << "The solution is:\n" << llt.solve(b) << endl; - A(1,1)++; - cout << "The matrix A is now:\n" << A << endl; - cout << "Computing LLT decomposition..." << endl; - llt.compute(A); - cout << "The solution is now:\n" << llt.solve(b) << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExComputeSolveError.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExComputeSolveError.cpp deleted file mode 100644 index f362fb71..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExComputeSolveError.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - MatrixXd A = MatrixXd::Random(100,100); - MatrixXd b = MatrixXd::Random(100,50); - MatrixXd x = A.fullPivLu().solve(b); - double relative_error = (A*x - b).norm() / b.norm(); // norm() is L2 norm - cout << "The relative error is:\n" << relative_error << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp deleted file mode 100644 index 3a99a94d..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Matrix3f A; - Vector3f b; - A << 1,2,3, 4,5,6, 7,8,10; - b << 3, 3, 4; - cout << "Here is the matrix A:\n" << A << endl; - cout << "Here is the vector b:\n" << b << endl; - Vector3f x = A.colPivHouseholderQr().solve(b); - cout << "The solution is:\n" << x << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp deleted file mode 100644 index f8beacd2..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgExSolveLDLT.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Matrix2f A, b; - A << 2, -1, -1, 3; - b << 1, 2, 3, 1; - cout << "Here is the matrix A:\n" << A << endl; - cout << "Here is the right hand side b:\n" << b << endl; - Matrix2f x = A.ldlt().solve(b); - cout << "The solution is:\n" << x << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgInverseDeterminant.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgInverseDeterminant.cpp deleted file mode 100644 index 43970ff0..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgInverseDeterminant.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Matrix3f A; - A << 1, 2, 1, - 2, 1, 0, - -1, 1, 2; - cout << "Here is the matrix A:\n" << A << endl; - cout << "The determinant of A is " << A.determinant() << endl; - cout << "The inverse of A is:\n" << A.inverse() << endl; -} \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgRankRevealing.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgRankRevealing.cpp deleted file mode 100644 index c5165077..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgRankRevealing.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Matrix3f A; - A << 1, 2, 5, - 2, 1, 4, - 3, 0, 3; - cout << "Here is the matrix A:\n" << A << endl; - FullPivLU lu_decomp(A); - cout << "The rank of A is " << lu_decomp.rank() << endl; - cout << "Here is a matrix whose columns form a basis of the null-space of A:\n" - << lu_decomp.kernel() << endl; - cout << "Here is a matrix whose columns form a basis of the column-space of A:\n" - << lu_decomp.image(A) << endl; // yes, have to pass the original A -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp deleted file mode 100644 index 9fbc031d..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSVDSolve.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - MatrixXf A = MatrixXf::Random(3, 2); - cout << "Here is the matrix A:\n" << A << endl; - VectorXf b = VectorXf::Random(3); - cout << "Here is the right hand side b:\n" << b << endl; - cout << "The least-squares solution is:\n" - << A.jacobiSvd(ComputeThinU | ComputeThinV).solve(b) << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp deleted file mode 100644 index 8d1d1ed6..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Matrix2f A; - A << 1, 2, 2, 3; - cout << "Here is the matrix A:\n" << A << endl; - SelfAdjointEigenSolver eigensolver(A); - if (eigensolver.info() != Success) abort(); - cout << "The eigenvalues of A are:\n" << eigensolver.eigenvalues() << endl; - cout << "Here's a matrix whose columns are eigenvectors of A \n" - << "corresponding to these eigenvalues:\n" - << eigensolver.eigenvectors() << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSetThreshold.cpp b/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSetThreshold.cpp deleted file mode 100644 index 3956b13a..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/TutorialLinAlgSetThreshold.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Matrix2d A; - A << 2, 1, - 2, 0.9999999999; - FullPivLU lu(A); - cout << "By default, the rank of A is found to be " << lu.rank() << endl; - lu.setThreshold(1e-5); - cout << "With threshold 1e-5, the rank of A is found to be " << lu.rank() << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_accessors.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_accessors.cpp deleted file mode 100644 index dc720ff5..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_accessors.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - ArrayXXf m(2,2); - - // assign some values coefficient by coefficient - m(0,0) = 1.0; m(0,1) = 2.0; - m(1,0) = 3.0; m(1,1) = m(0,1) + m(1,0); - - // print values to standard output - cout << m << endl << endl; - - // using the comma-initializer is also allowed - m << 1.0,2.0, - 3.0,4.0; - - // print values to standard output - cout << m << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_addition.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_addition.cpp deleted file mode 100644 index 480ffb00..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_addition.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - ArrayXXf a(3,3); - ArrayXXf b(3,3); - a << 1,2,3, - 4,5,6, - 7,8,9; - b << 1,2,3, - 1,2,3, - 1,2,3; - - // Adding two arrays - cout << "a + b = " << endl << a + b << endl << endl; - - // Subtracting a scalar from an array - cout << "a - 2 = " << endl << a - 2 << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_cwise_other.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_cwise_other.cpp deleted file mode 100644 index d9046c63..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_cwise_other.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - ArrayXf a = ArrayXf::Random(5); - a *= 2; - cout << "a =" << endl - << a << endl; - cout << "a.abs() =" << endl - << a.abs() << endl; - cout << "a.abs().sqrt() =" << endl - << a.abs().sqrt() << endl; - cout << "a.min(a.abs().sqrt()) =" << endl - << a.min(a.abs().sqrt()) << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_interop.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_interop.cpp deleted file mode 100644 index 371f0706..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_interop.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - MatrixXf m(2,2); - MatrixXf n(2,2); - MatrixXf result(2,2); - - m << 1,2, - 3,4; - n << 5,6, - 7,8; - - result = (m.array() + 4).matrix() * m; - cout << "-- Combination 1: --" << endl << result << endl << endl; - result = (m.array() * n.array()).matrix() * m; - cout << "-- Combination 2: --" << endl << result << endl << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp deleted file mode 100644 index 10142751..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - MatrixXf m(2,2); - MatrixXf n(2,2); - MatrixXf result(2,2); - - m << 1,2, - 3,4; - n << 5,6, - 7,8; - - result = m * n; - cout << "-- Matrix m*n: --" << endl << result << endl << endl; - result = m.array() * n.array(); - cout << "-- Array m*n: --" << endl << result << endl << endl; - result = m.cwiseProduct(n); - cout << "-- With cwiseProduct: --" << endl << result << endl << endl; - result = m.array() + 4; - cout << "-- Array m + 4: --" << endl << result << endl << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_mult.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_mult.cpp deleted file mode 100644 index 6cb439ff..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ArrayClass_mult.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main() -{ - ArrayXXf a(2,2); - ArrayXXf b(2,2); - a << 1,2, - 3,4; - b << 5,6, - 7,8; - cout << "a * b = " << endl << a * b << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_block_assignment.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_block_assignment.cpp deleted file mode 100644 index 76f49f2f..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_block_assignment.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Array22f m; - m << 1,2, - 3,4; - Array44f a = Array44f::Constant(0.6); - cout << "Here is the array a:" << endl << a << endl << endl; - a.block<2,2>(1,1) = m; - cout << "Here is now a with m copied into its central 2x2 block:" << endl << a << endl << endl; - a.block(0,0,2,3) = a.block(2,1,2,3); - cout << "Here is now a with bottom-right 2x3 block copied into top-left 2x2 block:" << endl << a << endl << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_colrow.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_colrow.cpp deleted file mode 100644 index 2e7eb009..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_colrow.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -using namespace std; - -int main() -{ - Eigen::MatrixXf m(3,3); - m << 1,2,3, - 4,5,6, - 7,8,9; - cout << "Here is the matrix m:" << endl << m << endl; - cout << "2nd Row: " << m.row(1) << endl; - m.col(2) += 3 * m.col(0); - cout << "After adding 3 times the first column into the third column, the matrix m is:\n"; - cout << m << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_corner.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_corner.cpp deleted file mode 100644 index 3a31507a..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_corner.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -using namespace std; - -int main() -{ - Eigen::Matrix4f m; - m << 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10,11,12, - 13,14,15,16; - cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl; - cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << endl; - m.topLeftCorner(1,3) = m.bottomRightCorner(3,1).transpose(); - cout << "After assignment, m = " << endl << m << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_print_block.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_print_block.cpp deleted file mode 100644 index edea4aef..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_print_block.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -using namespace std; - -int main() -{ - Eigen::MatrixXf m(4,4); - m << 1, 2, 3, 4, - 5, 6, 7, 8, - 9,10,11,12, - 13,14,15,16; - cout << "Block in the middle" << endl; - cout << m.block<2,2>(1,1) << endl << endl; - for (int i = 1; i <= 3; ++i) - { - cout << "Block of size " << i << "x" << i << endl; - cout << m.block(0,0,i,i) << endl << endl; - } -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_vector.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_vector.cpp deleted file mode 100644 index 4a0b0234..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_vector.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -using namespace std; - -int main() -{ - Eigen::ArrayXf v(6); - v << 1, 2, 3, 4, 5, 6; - cout << "v.head(3) =" << endl << v.head(3) << endl << endl; - cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl; - v.segment(1,4) *= 2; - cout << "after 'v.segment(1,4) *= 2', v =" << endl << v << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_PartialLU_solve.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_PartialLU_solve.cpp deleted file mode 100644 index a5608792..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_PartialLU_solve.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Matrix3f A; - Vector3f b; - A << 1,2,3, 4,5,6, 7,8,10; - b << 3, 3, 4; - cout << "Here is the matrix A:" << endl << A << endl; - cout << "Here is the vector b:" << endl << b << endl; - Vector3f x = A.lu().solve(b); - cout << "The solution is:" << endl << x << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp deleted file mode 100644 index 334b4d85..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Eigen::MatrixXf m(2,4); - Eigen::VectorXf v(2); - - m << 1, 23, 6, 9, - 3, 11, 7, 2; - - v << 2, - 3; - - MatrixXf::Index index; - // find nearest neighbour - (m.colwise() - v).colwise().squaredNorm().minCoeff(&index); - - cout << "Nearest neighbour is column " << index << ":" << endl; - cout << m.col(index) << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp deleted file mode 100644 index e6c87c6a..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -using namespace std; -int main() -{ - Eigen::MatrixXf mat(2,4); - Eigen::VectorXf v(2); - - mat << 1, 2, 6, 9, - 3, 1, 7, 2; - - v << 0, - 1; - - //add v to each column of m - mat.colwise() += v; - - std::cout << "Broadcasting result: " << std::endl; - std::cout << mat << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp deleted file mode 100644 index d87c96ab..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -using namespace std; -int main() -{ - Eigen::MatrixXf mat(2,4); - Eigen::VectorXf v(4); - - mat << 1, 2, 6, 9, - 3, 1, 7, 2; - - v << 0,1,2,3; - - //add v to each row of m - mat.rowwise() += v.transpose(); - - std::cout << "Broadcasting result: " << std::endl; - std::cout << mat << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp deleted file mode 100644 index df682566..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -using namespace std; -int main() -{ - Eigen::MatrixXf mat(2,4); - mat << 1, 2, 6, 9, - 3, 1, 7, 2; - - std::cout << "Column's maximum: " << std::endl - << mat.colwise().maxCoeff() << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp deleted file mode 100644 index 049c747b..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; -int main() -{ - MatrixXf mat(2,4); - mat << 1, 2, 6, 9, - 3, 1, 7, 2; - - MatrixXf::Index maxIndex; - float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex); - - std::cout << "Maximum sum at position " << maxIndex << std::endl; - - std::cout << "The corresponding vector is: " << std::endl; - std::cout << mat.col( maxIndex ) << std::endl; - std::cout << "And its sum is is: " << maxNorm << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp deleted file mode 100644 index 0cca37f3..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - ArrayXXf a(2,2); - - a << 1,2, - 3,4; - - cout << "(a > 0).all() = " << (a > 0).all() << endl; - cout << "(a > 0).any() = " << (a > 0).any() << endl; - cout << "(a > 0).count() = " << (a > 0).count() << endl; - cout << endl; - cout << "(a > 2).all() = " << (a > 2).all() << endl; - cout << "(a > 2).any() = " << (a > 2).any() << endl; - cout << "(a > 2).count() = " << (a > 2).count() << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp deleted file mode 100644 index 740439fb..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - VectorXf v(2); - MatrixXf m(2,2), n(2,2); - - v << -1, - 2; - - m << 1,-2, - -3,4; - - cout << "v.squaredNorm() = " << v.squaredNorm() << endl; - cout << "v.norm() = " << v.norm() << endl; - cout << "v.lpNorm<1>() = " << v.lpNorm<1>() << endl; - cout << "v.lpNorm() = " << v.lpNorm() << endl; - - cout << endl; - cout << "m.squaredNorm() = " << m.squaredNorm() << endl; - cout << "m.norm() = " << m.norm() << endl; - cout << "m.lpNorm<1>() = " << m.lpNorm<1>() << endl; - cout << "m.lpNorm() = " << m.lpNorm() << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp deleted file mode 100644 index 80427c9f..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -using namespace std; -int main() -{ - Eigen::MatrixXf mat(2,4); - mat << 1, 2, 6, 9, - 3, 1, 7, 2; - - std::cout << "Row's maximum: " << std::endl - << mat.rowwise().maxCoeff() << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp deleted file mode 100644 index b54e9aa3..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -using namespace std; -using namespace Eigen; - -int main() -{ - Eigen::MatrixXf m(2,2); - - m << 1, 2, - 3, 4; - - //get location of maximum - MatrixXf::Index maxRow, maxCol; - float max = m.maxCoeff(&maxRow, &maxCol); - - //get location of minimum - MatrixXf::Index minRow, minCol; - float min = m.minCoeff(&minRow, &minCol); - - cout << "Max: " << max << ", at: " << - maxRow << "," << maxCol << endl; - cout << "Min: " << min << ", at: " << - minRow << "," << minCol << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp b/testbed/nanogui/ext/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp deleted file mode 100644 index 0f0280e0..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/Tutorial_simple_example_dynamic_size.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -using namespace Eigen; - -int main() -{ - for (int size=1; size<=4; ++size) - { - MatrixXi m(size,size+1); // a (size)x(size+1)-matrix of int's - for (int j=0; j -#include - -using namespace Eigen; - -int main() -{ - Matrix3f m3; - m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9; - Matrix4f m4 = Matrix4f::Identity(); - Vector4i v4(1, 2, 3, 4); - - std::cout << "m3\n" << m3 << "\nm4:\n" - << m4 << "\nv4:\n" << v4 << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/class_Block.cpp b/testbed/nanogui/ext/eigen/doc/examples/class_Block.cpp deleted file mode 100644 index ace719af..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/class_Block.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -using namespace Eigen; -using namespace std; - -template -Eigen::Block -topLeftCorner(MatrixBase& m, int rows, int cols) -{ - return Eigen::Block(m.derived(), 0, 0, rows, cols); -} - -template -const Eigen::Block -topLeftCorner(const MatrixBase& m, int rows, int cols) -{ - return Eigen::Block(m.derived(), 0, 0, rows, cols); -} - -int main(int, char**) -{ - Matrix4d m = Matrix4d::Identity(); - cout << topLeftCorner(4*m, 2, 3) << endl; // calls the const version - topLeftCorner(m, 2, 3) *= 5; // calls the non-const version - cout << "Now the matrix m is:" << endl << m << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/class_CwiseBinaryOp.cpp b/testbed/nanogui/ext/eigen/doc/examples/class_CwiseBinaryOp.cpp deleted file mode 100644 index 682af46d..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/class_CwiseBinaryOp.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -using namespace Eigen; -using namespace std; - -// define a custom template binary functor -template struct MakeComplexOp { - EIGEN_EMPTY_STRUCT_CTOR(MakeComplexOp) - typedef complex result_type; - complex operator()(const Scalar& a, const Scalar& b) const { return complex(a,b); } -}; - -int main(int, char**) -{ - Matrix4d m1 = Matrix4d::Random(), m2 = Matrix4d::Random(); - cout << m1.binaryExpr(m2, MakeComplexOp()) << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/class_CwiseUnaryOp.cpp b/testbed/nanogui/ext/eigen/doc/examples/class_CwiseUnaryOp.cpp deleted file mode 100644 index a5fcc153..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/class_CwiseUnaryOp.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -using namespace Eigen; -using namespace std; - -// define a custom template unary functor -template -struct CwiseClampOp { - CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {} - const Scalar operator()(const Scalar& x) const { return xm_sup ? m_sup : x); } - Scalar m_inf, m_sup; -}; - -int main(int, char**) -{ - Matrix4d m1 = Matrix4d::Random(); - cout << m1 << endl << "becomes: " << endl << m1.unaryExpr(CwiseClampOp(-0.5,0.5)) << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/class_CwiseUnaryOp_ptrfun.cpp b/testbed/nanogui/ext/eigen/doc/examples/class_CwiseUnaryOp_ptrfun.cpp deleted file mode 100644 index 36706d8e..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/class_CwiseUnaryOp_ptrfun.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -using namespace Eigen; -using namespace std; - -// define function to be applied coefficient-wise -double ramp(double x) -{ - if (x > 0) - return x; - else - return 0; -} - -int main(int, char**) -{ - Matrix4d m1 = Matrix4d::Random(); - cout << m1 << endl << "becomes: " << endl << m1.unaryExpr(ptr_fun(ramp)) << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/class_FixedBlock.cpp b/testbed/nanogui/ext/eigen/doc/examples/class_FixedBlock.cpp deleted file mode 100644 index 9978b32e..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/class_FixedBlock.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -using namespace Eigen; -using namespace std; - -template -Eigen::Block -topLeft2x2Corner(MatrixBase& m) -{ - return Eigen::Block(m.derived(), 0, 0); -} - -template -const Eigen::Block -topLeft2x2Corner(const MatrixBase& m) -{ - return Eigen::Block(m.derived(), 0, 0); -} - -int main(int, char**) -{ - Matrix3d m = Matrix3d::Identity(); - cout << topLeft2x2Corner(4*m) << endl; // calls the const version - topLeft2x2Corner(m) *= 2; // calls the non-const version - cout << "Now the matrix m is:" << endl << m << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/class_FixedVectorBlock.cpp b/testbed/nanogui/ext/eigen/doc/examples/class_FixedVectorBlock.cpp deleted file mode 100644 index c88c9fbf..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/class_FixedVectorBlock.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -using namespace Eigen; -using namespace std; - -template -Eigen::VectorBlock -firstTwo(MatrixBase& v) -{ - return Eigen::VectorBlock(v.derived(), 0); -} - -template -const Eigen::VectorBlock -firstTwo(const MatrixBase& v) -{ - return Eigen::VectorBlock(v.derived(), 0); -} - -int main(int, char**) -{ - Matrix v; v << 1,2,3,4,5,6; - cout << firstTwo(4*v) << endl; // calls the const version - firstTwo(v) *= 2; // calls the non-const version - cout << "Now the vector v is:" << endl << v << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/class_VectorBlock.cpp b/testbed/nanogui/ext/eigen/doc/examples/class_VectorBlock.cpp deleted file mode 100644 index dc213df2..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/class_VectorBlock.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -using namespace Eigen; -using namespace std; - -template -Eigen::VectorBlock -segmentFromRange(MatrixBase& v, int start, int end) -{ - return Eigen::VectorBlock(v.derived(), start, end-start); -} - -template -const Eigen::VectorBlock -segmentFromRange(const MatrixBase& v, int start, int end) -{ - return Eigen::VectorBlock(v.derived(), start, end-start); -} - -int main(int, char**) -{ - Matrix v; v << 1,2,3,4,5,6; - cout << segmentFromRange(2*v, 2, 4) << endl; // calls the const version - segmentFromRange(v, 1, 3) *= 5; // calls the non-const version - cout << "Now the vector v is:" << endl << v << endl; - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/function_taking_eigenbase.cpp b/testbed/nanogui/ext/eigen/doc/examples/function_taking_eigenbase.cpp deleted file mode 100644 index 49d94b3d..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/function_taking_eigenbase.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -using namespace Eigen; - -template -void print_size(const EigenBase& b) -{ - std::cout << "size (rows, cols): " << b.size() << " (" << b.rows() - << ", " << b.cols() << ")" << std::endl; -} - -int main() -{ - Vector3f v; - print_size(v); - // v.asDiagonal() returns a 3x3 diagonal matrix pseudo-expression - print_size(v.asDiagonal()); -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/function_taking_ref.cpp b/testbed/nanogui/ext/eigen/doc/examples/function_taking_ref.cpp deleted file mode 100644 index 162a202e..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/function_taking_ref.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -using namespace Eigen; -using namespace std; - -float inv_cond(const Ref& a) -{ - const VectorXf sing_vals = a.jacobiSvd().singularValues(); - return sing_vals(sing_vals.size()-1) / sing_vals(0); -} - -int main() -{ - Matrix4f m = Matrix4f::Random(); - cout << "matrix m:" << endl << m << endl << endl; - cout << "inv_cond(m): " << inv_cond(m) << endl; - cout << "inv_cond(m(1:3,1:3)): " << inv_cond(m.topLeftCorner(3,3)) << endl; - cout << "inv_cond(m+I): " << inv_cond(m+Matrix4f::Identity()) << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_add_sub.cpp b/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_add_sub.cpp deleted file mode 100644 index e97477b6..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_add_sub.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -using namespace Eigen; - -int main() -{ - Matrix2d a; - a << 1, 2, - 3, 4; - MatrixXd b(2,2); - b << 2, 3, - 1, 4; - std::cout << "a + b =\n" << a + b << std::endl; - std::cout << "a - b =\n" << a - b << std::endl; - std::cout << "Doing a += b;" << std::endl; - a += b; - std::cout << "Now a =\n" << a << std::endl; - Vector3d v(1,2,3); - Vector3d w(1,0,0); - std::cout << "-v + w - v =\n" << -v + w - v << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_dot_cross.cpp b/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_dot_cross.cpp deleted file mode 100644 index 631c9a5e..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_dot_cross.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; -int main() -{ - Vector3d v(1,2,3); - Vector3d w(0,1,2); - - cout << "Dot product: " << v.dot(w) << endl; - double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar - cout << "Dot product via a matrix product: " << dp << endl; - cout << "Cross product:\n" << v.cross(w) << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_matrix_mul.cpp b/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_matrix_mul.cpp deleted file mode 100644 index f2139024..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_matrix_mul.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -using namespace Eigen; -int main() -{ - Matrix2d mat; - mat << 1, 2, - 3, 4; - Vector2d u(-1,1), v(2,0); - std::cout << "Here is mat*mat:\n" << mat*mat << std::endl; - std::cout << "Here is mat*u:\n" << mat*u << std::endl; - std::cout << "Here is u^T*mat:\n" << u.transpose()*mat << std::endl; - std::cout << "Here is u^T*v:\n" << u.transpose()*v << std::endl; - std::cout << "Here is u*v^T:\n" << u*v.transpose() << std::endl; - std::cout << "Let's multiply mat by itself" << std::endl; - mat = mat*mat; - std::cout << "Now mat is mat:\n" << mat << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_redux_basic.cpp b/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_redux_basic.cpp deleted file mode 100644 index 5632fb52..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_redux_basic.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -using namespace std; -int main() -{ - Eigen::Matrix2d mat; - mat << 1, 2, - 3, 4; - cout << "Here is mat.sum(): " << mat.sum() << endl; - cout << "Here is mat.prod(): " << mat.prod() << endl; - cout << "Here is mat.mean(): " << mat.mean() << endl; - cout << "Here is mat.minCoeff(): " << mat.minCoeff() << endl; - cout << "Here is mat.maxCoeff(): " << mat.maxCoeff() << endl; - cout << "Here is mat.trace(): " << mat.trace() << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_scalar_mul_div.cpp b/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_scalar_mul_div.cpp deleted file mode 100644 index d5f65b53..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/tut_arithmetic_scalar_mul_div.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -using namespace Eigen; - -int main() -{ - Matrix2d a; - a << 1, 2, - 3, 4; - Vector3d v(1,2,3); - std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl; - std::cout << "0.1 * v =\n" << 0.1 * v << std::endl; - std::cout << "Doing v *= 2;" << std::endl; - v *= 2; - std::cout << "Now v =\n" << v << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_coefficient_accessors.cpp b/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_coefficient_accessors.cpp deleted file mode 100644 index c2da1715..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_coefficient_accessors.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -using namespace Eigen; - -int main() -{ - MatrixXd m(2,2); - m(0,0) = 3; - m(1,0) = 2.5; - m(0,1) = -1; - m(1,1) = m(1,0) + m(0,1); - std::cout << "Here is the matrix m:\n" << m << std::endl; - VectorXd v(2); - v(0) = 4; - v(1) = v(0) - 1; - std::cout << "Here is the vector v:\n" << v << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_resize.cpp b/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_resize.cpp deleted file mode 100644 index 0392c3aa..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_resize.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -using namespace Eigen; - -int main() -{ - MatrixXd m(2,5); - m.resize(4,3); - std::cout << "The matrix m is of size " - << m.rows() << "x" << m.cols() << std::endl; - std::cout << "It has " << m.size() << " coefficients" << std::endl; - VectorXd v(2); - v.resize(5); - std::cout << "The vector v is of size " << v.size() << std::endl; - std::cout << "As a matrix, v is of size " - << v.rows() << "x" << v.cols() << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_resize_fixed_size.cpp b/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_resize_fixed_size.cpp deleted file mode 100644 index dcbdfa78..00000000 --- a/testbed/nanogui/ext/eigen/doc/examples/tut_matrix_resize_fixed_size.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -using namespace Eigen; - -int main() -{ - Matrix4d m; - m.resize(4,4); // no operation - std::cout << "The matrix m is of size " - << m.rows() << "x" << m.cols() << std::endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/snippets/.krazy b/testbed/nanogui/ext/eigen/doc/snippets/.krazy deleted file mode 100644 index 00b99405..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/.krazy +++ /dev/null @@ -1,2 +0,0 @@ -EXCLUDE copyright -EXCLUDE license diff --git a/testbed/nanogui/ext/eigen/doc/snippets/AngleAxis_mimic_euler.cpp b/testbed/nanogui/ext/eigen/doc/snippets/AngleAxis_mimic_euler.cpp deleted file mode 100644 index 456de7f7..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/AngleAxis_mimic_euler.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3f m; -m = AngleAxisf(0.25*M_PI, Vector3f::UnitX()) - * AngleAxisf(0.5*M_PI, Vector3f::UnitY()) - * AngleAxisf(0.33*M_PI, Vector3f::UnitZ()); -cout << m << endl << "is unitary: " << m.isUnitary() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/CMakeLists.txt b/testbed/nanogui/ext/eigen/doc/snippets/CMakeLists.txt deleted file mode 100644 index 1135900c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -file(GLOB snippets_SRCS "*.cpp") - -add_custom_target(all_snippets) - -foreach(snippet_src ${snippets_SRCS}) - get_filename_component(snippet ${snippet_src} NAME_WE) - set(compile_snippet_target compile_${snippet}) - set(compile_snippet_src ${compile_snippet_target}.cpp) - file(READ ${snippet_src} snippet_source_code) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compile_snippet.cpp.in - ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}) - add_executable(${compile_snippet_target} - ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}) - if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) - target_link_libraries(${compile_snippet_target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) - endif() - add_custom_command( - TARGET ${compile_snippet_target} - POST_BUILD - COMMAND ${compile_snippet_target} - ARGS >${CMAKE_CURRENT_BINARY_DIR}/${snippet}.out - ) - add_dependencies(all_snippets ${compile_snippet_target}) - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src} - PROPERTIES OBJECT_DEPENDS ${snippet_src}) -endforeach(snippet_src) - -ei_add_target_property(compile_tut_arithmetic_transpose_aliasing COMPILE_FLAGS -DEIGEN_NO_DEBUG) diff --git a/testbed/nanogui/ext/eigen/doc/snippets/ColPivHouseholderQR_solve.cpp b/testbed/nanogui/ext/eigen/doc/snippets/ColPivHouseholderQR_solve.cpp deleted file mode 100644 index b7b204a1..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/ColPivHouseholderQR_solve.cpp +++ /dev/null @@ -1,8 +0,0 @@ -Matrix3f m = Matrix3f::Random(); -Matrix3f y = Matrix3f::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the matrix y:" << endl << y << endl; -Matrix3f x; -x = m.colPivHouseholderQr().solve(y); -assert(y.isApprox(m*x)); -cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_compute.cpp b/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_compute.cpp deleted file mode 100644 index 11d6bd39..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_compute.cpp +++ /dev/null @@ -1,16 +0,0 @@ -MatrixXcf A = MatrixXcf::Random(4,4); -cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl; - -ComplexEigenSolver ces; -ces.compute(A); -cout << "The eigenvalues of A are:" << endl << ces.eigenvalues() << endl; -cout << "The matrix of eigenvectors, V, is:" << endl << ces.eigenvectors() << endl << endl; - -complex lambda = ces.eigenvalues()[0]; -cout << "Consider the first eigenvalue, lambda = " << lambda << endl; -VectorXcf v = ces.eigenvectors().col(0); -cout << "If v is the corresponding eigenvector, then lambda * v = " << endl << lambda * v << endl; -cout << "... and A * v = " << endl << A * v << endl << endl; - -cout << "Finally, V * D * V^(-1) = " << endl - << ces.eigenvectors() * ces.eigenvalues().asDiagonal() * ces.eigenvectors().inverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_eigenvalues.cpp b/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_eigenvalues.cpp deleted file mode 100644 index 5509bd89..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_eigenvalues.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXcf ones = MatrixXcf::Ones(3,3); -ComplexEigenSolver ces(ones, /* computeEigenvectors = */ false); -cout << "The eigenvalues of the 3x3 matrix of ones are:" - << endl << ces.eigenvalues() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_eigenvectors.cpp b/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_eigenvectors.cpp deleted file mode 100644 index bb1c2ccf..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/ComplexEigenSolver_eigenvectors.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXcf ones = MatrixXcf::Ones(3,3); -ComplexEigenSolver ces(ones); -cout << "The first eigenvector of the 3x3 matrix of ones is:" - << endl << ces.eigenvectors().col(1) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_compute.cpp b/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_compute.cpp deleted file mode 100644 index 3a517010..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_compute.cpp +++ /dev/null @@ -1,6 +0,0 @@ -MatrixXcf A = MatrixXcf::Random(4,4); -ComplexSchur schur(4); -schur.compute(A); -cout << "The matrix T in the decomposition of A is:" << endl << schur.matrixT() << endl; -schur.compute(A.inverse()); -cout << "The matrix T in the decomposition of A^(-1) is:" << endl << schur.matrixT() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_matrixT.cpp b/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_matrixT.cpp deleted file mode 100644 index 8380571a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_matrixT.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXcf A = MatrixXcf::Random(4,4); -cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl; -ComplexSchur schurOfA(A, false); // false means do not compute U -cout << "The triangular matrix T is:" << endl << schurOfA.matrixT() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_matrixU.cpp b/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_matrixU.cpp deleted file mode 100644 index ba3d9c22..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/ComplexSchur_matrixU.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXcf A = MatrixXcf::Random(4,4); -cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl; -ComplexSchur schurOfA(A); -cout << "The unitary matrix U is:" << endl << schurOfA.matrixU() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_abs.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Cwise_abs.cpp deleted file mode 100644 index 0aeec3a4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_abs.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Array3d v(1,-2,-3); -cout << v.abs() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_abs2.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Cwise_abs2.cpp deleted file mode 100644 index 2c4f9b34..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_abs2.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Array3d v(1,-2,-3); -cout << v.abs2() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_acos.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Cwise_acos.cpp deleted file mode 100644 index 34432cba..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_acos.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Array3d v(0, sqrt(2.)/2, 1); -cout << v.acos() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_asin.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Cwise_asin.cpp deleted file mode 100644 index 8dad838f..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_asin.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Array3d v(0, sqrt(2.)/2, 1); -cout << v.asin() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_boolean_and.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Cwise_boolean_and.cpp deleted file mode 100644 index df6b60d9..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_boolean_and.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Array3d v(-1,2,1), w(-3,2,3); -cout << ((vw) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_greater_equal.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Cwise_greater_equal.cpp deleted file mode 100644 index 6a08f894..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_greater_equal.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Array3d v(1,2,3), w(3,2,1); -cout << (v>=w) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_inverse.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Cwise_inverse.cpp deleted file mode 100644 index 3967a7ec..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_inverse.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Array3d v(2,3,4); -cout << v.inverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_less.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Cwise_less.cpp deleted file mode 100644 index cafd3b6e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Cwise_less.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Array3d v(1,2,3), w(3,2,1); -cout << (v() = ..." << endl; -cout << m.colwise().replicate<3>() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/DirectionWise_replicate_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/DirectionWise_replicate_int.cpp deleted file mode 100644 index f9b1b535..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/DirectionWise_replicate_int.cpp +++ /dev/null @@ -1,4 +0,0 @@ -Vector3i v = Vector3i::Random(); -cout << "Here is the vector v:" << endl << v << endl; -cout << "v.rowwise().replicate(5) = ..." << endl; -cout << v.rowwise().replicate(5) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp b/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp deleted file mode 100644 index c1d9fa87..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp +++ /dev/null @@ -1,16 +0,0 @@ -MatrixXd A = MatrixXd::Random(6,6); -cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl; - -EigenSolver es(A); -cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl; -cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl; - -complex lambda = es.eigenvalues()[0]; -cout << "Consider the first eigenvalue, lambda = " << lambda << endl; -VectorXcd v = es.eigenvectors().col(0); -cout << "If v is the corresponding eigenvector, then lambda * v = " << endl << lambda * v << endl; -cout << "... and A * v = " << endl << A.cast >() * v << endl << endl; - -MatrixXcd D = es.eigenvalues().asDiagonal(); -MatrixXcd V = es.eigenvectors(); -cout << "Finally, V * D * V^(-1) = " << endl << V * D * V.inverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_compute.cpp b/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_compute.cpp deleted file mode 100644 index a5c96e9b..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_compute.cpp +++ /dev/null @@ -1,6 +0,0 @@ -EigenSolver es; -MatrixXf A = MatrixXf::Random(4,4); -es.compute(A, /* computeEigenvectors = */ false); -cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl; -es.compute(A + MatrixXf::Identity(4,4), false); // re-use es to compute eigenvalues of A+I -cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_eigenvalues.cpp b/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_eigenvalues.cpp deleted file mode 100644 index ed28869a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_eigenvalues.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXd ones = MatrixXd::Ones(3,3); -EigenSolver es(ones, false); -cout << "The eigenvalues of the 3x3 matrix of ones are:" - << endl << es.eigenvalues() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_eigenvectors.cpp b/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_eigenvectors.cpp deleted file mode 100644 index 0fad4dad..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_eigenvectors.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXd ones = MatrixXd::Ones(3,3); -EigenSolver es(ones); -cout << "The first eigenvector of the 3x3 matrix of ones is:" - << endl << es.eigenvectors().col(1) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_pseudoEigenvectors.cpp b/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_pseudoEigenvectors.cpp deleted file mode 100644 index 85e2569d..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/EigenSolver_pseudoEigenvectors.cpp +++ /dev/null @@ -1,9 +0,0 @@ -MatrixXd A = MatrixXd::Random(6,6); -cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl; - -EigenSolver es(A); -MatrixXd D = es.pseudoEigenvalueMatrix(); -MatrixXd V = es.pseudoEigenvectors(); -cout << "The pseudo-eigenvalue matrix D is:" << endl << D << endl; -cout << "The pseudo-eigenvector matrix V is:" << endl << V << endl; -cout << "Finally, V * D * V^(-1) = " << endl << V * D * V.inverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/FullPivHouseholderQR_solve.cpp b/testbed/nanogui/ext/eigen/doc/snippets/FullPivHouseholderQR_solve.cpp deleted file mode 100644 index 23bc0749..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/FullPivHouseholderQR_solve.cpp +++ /dev/null @@ -1,8 +0,0 @@ -Matrix3f m = Matrix3f::Random(); -Matrix3f y = Matrix3f::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the matrix y:" << endl << y << endl; -Matrix3f x; -x = m.fullPivHouseholderQr().solve(y); -assert(y.isApprox(m*x)); -cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_image.cpp b/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_image.cpp deleted file mode 100644 index 817bc1e2..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_image.cpp +++ /dev/null @@ -1,9 +0,0 @@ -Matrix3d m; -m << 1,1,0, - 1,3,2, - 0,1,1; -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Notice that the middle column is the sum of the two others, so the " - << "columns are linearly dependent." << endl; -cout << "Here is a matrix whose columns have the same span but are linearly independent:" - << endl << m.fullPivLu().image(m) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_kernel.cpp b/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_kernel.cpp deleted file mode 100644 index 7086e01e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_kernel.cpp +++ /dev/null @@ -1,7 +0,0 @@ -MatrixXf m = MatrixXf::Random(3,5); -cout << "Here is the matrix m:" << endl << m << endl; -MatrixXf ker = m.fullPivLu().kernel(); -cout << "Here is a matrix whose columns form a basis of the kernel of m:" - << endl << ker << endl; -cout << "By definition of the kernel, m*ker is zero:" - << endl << m*ker << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_solve.cpp b/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_solve.cpp deleted file mode 100644 index c1f88235..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/FullPivLU_solve.cpp +++ /dev/null @@ -1,11 +0,0 @@ -Matrix m = Matrix::Random(); -Matrix2f y = Matrix2f::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the matrix y:" << endl << y << endl; -Matrix x = m.fullPivLu().solve(y); -if((m*x).isApprox(y)) -{ - cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; -} -else - cout << "The equation mx=y does not have any solution." << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/GeneralizedEigenSolver.cpp b/testbed/nanogui/ext/eigen/doc/snippets/GeneralizedEigenSolver.cpp deleted file mode 100644 index 2acda45f..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/GeneralizedEigenSolver.cpp +++ /dev/null @@ -1,7 +0,0 @@ -GeneralizedEigenSolver ges; -MatrixXf A = MatrixXf::Random(4,4); -MatrixXf B = MatrixXf::Random(4,4); -ges.compute(A, B); -cout << "The (complex) numerators of the generalzied eigenvalues are: " << ges.alphas().transpose() << endl; -cout << "The (real) denominatore of the generalzied eigenvalues are: " << ges.betas().transpose() << endl; -cout << "The (complex) generalzied eigenvalues are (alphas./beta): " << ges.eigenvalues().transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_compute.cpp b/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_compute.cpp deleted file mode 100644 index 50e37833..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_compute.cpp +++ /dev/null @@ -1,6 +0,0 @@ -MatrixXcf A = MatrixXcf::Random(4,4); -HessenbergDecomposition hd(4); -hd.compute(A); -cout << "The matrix H in the decomposition of A is:" << endl << hd.matrixH() << endl; -hd.compute(2*A); // re-use hd to compute and store decomposition of 2A -cout << "The matrix H in the decomposition of 2A is:" << endl << hd.matrixH() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_matrixH.cpp b/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_matrixH.cpp deleted file mode 100644 index af013666..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_matrixH.cpp +++ /dev/null @@ -1,8 +0,0 @@ -Matrix4f A = MatrixXf::Random(4,4); -cout << "Here is a random 4x4 matrix:" << endl << A << endl; -HessenbergDecomposition hessOfA(A); -MatrixXf H = hessOfA.matrixH(); -cout << "The Hessenberg matrix H is:" << endl << H << endl; -MatrixXf Q = hessOfA.matrixQ(); -cout << "The orthogonal matrix Q is:" << endl << Q << endl; -cout << "Q H Q^T is:" << endl << Q * H * Q.transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_packedMatrix.cpp b/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_packedMatrix.cpp deleted file mode 100644 index 4fa5957e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/HessenbergDecomposition_packedMatrix.cpp +++ /dev/null @@ -1,9 +0,0 @@ -Matrix4d A = Matrix4d::Random(4,4); -cout << "Here is a random 4x4 matrix:" << endl << A << endl; -HessenbergDecomposition hessOfA(A); -Matrix4d pm = hessOfA.packedMatrix(); -cout << "The packed matrix M is:" << endl << pm << endl; -cout << "The upper Hessenberg part corresponds to the matrix H, which is:" - << endl << hessOfA.matrixH() << endl; -Vector3d hc = hessOfA.householderCoefficients(); -cout << "The vector of Householder coefficients is:" << endl << hc << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/HouseholderQR_householderQ.cpp b/testbed/nanogui/ext/eigen/doc/snippets/HouseholderQR_householderQ.cpp deleted file mode 100644 index e859ce55..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/HouseholderQR_householderQ.cpp +++ /dev/null @@ -1,7 +0,0 @@ -MatrixXf A(MatrixXf::Random(5,3)), thinQ(MatrixXf::Identity(5,3)), Q; -A.setRandom(); -HouseholderQR qr(A); -Q = qr.householderQ(); -thinQ = qr.householderQ() * thinQ; -std::cout << "The complete unitary matrix Q is:\n" << Q << "\n\n"; -std::cout << "The thin matrix Q is:\n" << thinQ << "\n\n"; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/HouseholderQR_solve.cpp b/testbed/nanogui/ext/eigen/doc/snippets/HouseholderQR_solve.cpp deleted file mode 100644 index 8cce6ce6..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/HouseholderQR_solve.cpp +++ /dev/null @@ -1,9 +0,0 @@ -typedef Matrix Matrix3x3; -Matrix3x3 m = Matrix3x3::Random(); -Matrix3f y = Matrix3f::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the matrix y:" << endl << y << endl; -Matrix3f x; -x = m.householderQr().solve(y); -assert(y.isApprox(m*x)); -cout << "Here is a solution x to the equation mx=y:" << endl << x << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/HouseholderSequence_HouseholderSequence.cpp b/testbed/nanogui/ext/eigen/doc/snippets/HouseholderSequence_HouseholderSequence.cpp deleted file mode 100644 index 2632b83b..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/HouseholderSequence_HouseholderSequence.cpp +++ /dev/null @@ -1,31 +0,0 @@ -Matrix3d v = Matrix3d::Random(); -cout << "The matrix v is:" << endl; -cout << v << endl; - -Vector3d v0(1, v(1,0), v(2,0)); -cout << "The first Householder vector is: v_0 = " << v0.transpose() << endl; -Vector3d v1(0, 1, v(2,1)); -cout << "The second Householder vector is: v_1 = " << v1.transpose() << endl; -Vector3d v2(0, 0, 1); -cout << "The third Householder vector is: v_2 = " << v2.transpose() << endl; - -Vector3d h = Vector3d::Random(); -cout << "The Householder coefficients are: h = " << h.transpose() << endl; - -Matrix3d H0 = Matrix3d::Identity() - h(0) * v0 * v0.adjoint(); -cout << "The first Householder reflection is represented by H_0 = " << endl; -cout << H0 << endl; -Matrix3d H1 = Matrix3d::Identity() - h(1) * v1 * v1.adjoint(); -cout << "The second Householder reflection is represented by H_1 = " << endl; -cout << H1 << endl; -Matrix3d H2 = Matrix3d::Identity() - h(2) * v2 * v2.adjoint(); -cout << "The third Householder reflection is represented by H_2 = " << endl; -cout << H2 << endl; -cout << "Their product is H_0 H_1 H_2 = " << endl; -cout << H0 * H1 * H2 << endl; - -HouseholderSequence hhSeq(v, h); -Matrix3d hhSeqAsMatrix(hhSeq); -cout << "If we construct a HouseholderSequence from v and h" << endl; -cout << "and convert it to a matrix, we get:" << endl; -cout << hhSeqAsMatrix << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/IOFormat.cpp b/testbed/nanogui/ext/eigen/doc/snippets/IOFormat.cpp deleted file mode 100644 index 735f5dd8..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/IOFormat.cpp +++ /dev/null @@ -1,14 +0,0 @@ -std::string sep = "\n----------------------------------------\n"; -Matrix3d m1; -m1 << 1.111111, 2, 3.33333, 4, 5, 6, 7, 8.888888, 9; - -IOFormat CommaInitFmt(StreamPrecision, DontAlignCols, ", ", ", ", "", "", " << ", ";"); -IOFormat CleanFmt(4, 0, ", ", "\n", "[", "]"); -IOFormat OctaveFmt(StreamPrecision, 0, ", ", ";\n", "", "", "[", "]"); -IOFormat HeavyFmt(FullPrecision, 0, ", ", ";\n", "[", "]", "[", "]"); - -std::cout << m1 << sep; -std::cout << m1.format(CommaInitFmt) << sep; -std::cout << m1.format(CleanFmt) << sep; -std::cout << m1.format(OctaveFmt) << sep; -std::cout << m1.format(HeavyFmt) << sep; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/JacobiSVD_basic.cpp b/testbed/nanogui/ext/eigen/doc/snippets/JacobiSVD_basic.cpp deleted file mode 100644 index ab24b9bc..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/JacobiSVD_basic.cpp +++ /dev/null @@ -1,9 +0,0 @@ -MatrixXf m = MatrixXf::Random(3,2); -cout << "Here is the matrix m:" << endl << m << endl; -JacobiSVD svd(m, ComputeThinU | ComputeThinV); -cout << "Its singular values are:" << endl << svd.singularValues() << endl; -cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU() << endl; -cout << "Its right singular vectors are the columns of the thin V matrix:" << endl << svd.matrixV() << endl; -Vector3f rhs(1, 0, 0); -cout << "Now consider this rhs vector:" << endl << rhs << endl; -cout << "A least-squares solution of m*x = rhs is:" << endl << svd.solve(rhs) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Jacobi_makeGivens.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Jacobi_makeGivens.cpp deleted file mode 100644 index 4b733c30..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Jacobi_makeGivens.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Vector2f v = Vector2f::Random(); -JacobiRotation G; -G.makeGivens(v.x(), v.y()); -cout << "Here is the vector v:" << endl << v << endl; -v.applyOnTheLeft(0, 1, G.adjoint()); -cout << "Here is the vector J' * v:" << endl << v << endl; \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Jacobi_makeJacobi.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Jacobi_makeJacobi.cpp deleted file mode 100644 index 0cc331d9..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Jacobi_makeJacobi.cpp +++ /dev/null @@ -1,8 +0,0 @@ -Matrix2f m = Matrix2f::Random(); -m = (m + m.adjoint()).eval(); -JacobiRotation J; -J.makeJacobi(m, 0, 1); -cout << "Here is the matrix m:" << endl << m << endl; -m.applyOnTheLeft(0, 1, J.adjoint()); -m.applyOnTheRight(0, 1, J); -cout << "Here is the matrix J' * m * J:" << endl << m << endl; \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/snippets/LLT_example.cpp b/testbed/nanogui/ext/eigen/doc/snippets/LLT_example.cpp deleted file mode 100644 index 46fb4070..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/LLT_example.cpp +++ /dev/null @@ -1,12 +0,0 @@ -MatrixXd A(3,3); -A << 4,-1,2, -1,6,0, 2,0,5; -cout << "The matrix A is" << endl << A << endl; - -LLT lltOfA(A); // compute the Cholesky decomposition of A -MatrixXd L = lltOfA.matrixL(); // retrieve factor L in the decomposition -// The previous two lines can also be written as "L = A.llt().matrixL()" - -cout << "The Cholesky factor L is" << endl << L << endl; -cout << "To check this, let us compute L * L.transpose()" << endl; -cout << L * L.transpose() << endl; -cout << "This should equal the matrix A" << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/LLT_solve.cpp b/testbed/nanogui/ext/eigen/doc/snippets/LLT_solve.cpp deleted file mode 100644 index 7095d2cc..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/LLT_solve.cpp +++ /dev/null @@ -1,8 +0,0 @@ -typedef Matrix DataMatrix; -// let's generate some samples on the 3D plane of equation z = 2x+3y (with some noise) -DataMatrix samples = DataMatrix::Random(12,2); -VectorXf elevations = 2*samples.col(0) + 3*samples.col(1) + VectorXf::Random(12)*0.1; -// and let's solve samples * [x y]^T = elevations in least square sense: -Matrix xy - = (samples.adjoint() * samples).llt().solve((samples.adjoint()*elevations)); -cout << xy << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Map_general_stride.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Map_general_stride.cpp deleted file mode 100644 index 0657e7f8..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Map_general_stride.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int array[24]; -for(int i = 0; i < 24; ++i) array[i] = i; -cout << Map > - (array, 3, 3, Stride(8, 2)) - << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Map_inner_stride.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Map_inner_stride.cpp deleted file mode 100644 index d95ae9b3..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Map_inner_stride.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int array[12]; -for(int i = 0; i < 12; ++i) array[i] = i; -cout << Map > - (array, 6) // the inner stride has already been passed as template parameter - << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Map_outer_stride.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Map_outer_stride.cpp deleted file mode 100644 index 2f6f052c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Map_outer_stride.cpp +++ /dev/null @@ -1,3 +0,0 @@ -int array[12]; -for(int i = 0; i < 12; ++i) array[i] = i; -cout << Map >(array, 3, 3, OuterStride<>(4)) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Map_placement_new.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Map_placement_new.cpp deleted file mode 100644 index 2e40eca3..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Map_placement_new.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int data[] = {1,2,3,4,5,6,7,8,9}; -Map v(data,4); -cout << "The mapped vector v is: " << v << "\n"; -new (&v) Map(data+4,5); -cout << "Now v is: " << v << "\n"; \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Map_simple.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Map_simple.cpp deleted file mode 100644 index 423bb52a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Map_simple.cpp +++ /dev/null @@ -1,3 +0,0 @@ -int array[9]; -for(int i = 0; i < 9; ++i) array[i] = i; -cout << Map(array) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_adjoint.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_adjoint.cpp deleted file mode 100644 index 4680d593..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_adjoint.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix2cf m = Matrix2cf::Random(); -cout << "Here is the 2x2 complex matrix m:" << endl << m << endl; -cout << "Here is the adjoint of m:" << endl << m.adjoint() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_all.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_all.cpp deleted file mode 100644 index 46f26f18..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_all.cpp +++ /dev/null @@ -1,7 +0,0 @@ -Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones()); -Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs(); -// let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax: -cout << "Is (" << p0.transpose() << ") inside the box: " - << ((boxMin.array()p0.array()).all()) << endl; -cout << "Is (" << p1.transpose() << ") inside the box: " - << ((boxMin.array()p1.array()).all()) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_applyOnTheLeft.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_applyOnTheLeft.cpp deleted file mode 100644 index 6398c873..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_applyOnTheLeft.cpp +++ /dev/null @@ -1,7 +0,0 @@ -Matrix3f A = Matrix3f::Random(3,3), B; -B << 0,1,0, - 0,0,1, - 1,0,0; -cout << "At start, A = " << endl << A << endl; -A.applyOnTheLeft(B); -cout << "After applyOnTheLeft, A = " << endl << A << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_applyOnTheRight.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_applyOnTheRight.cpp deleted file mode 100644 index e4b71b2d..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_applyOnTheRight.cpp +++ /dev/null @@ -1,9 +0,0 @@ -Matrix3f A = Matrix3f::Random(3,3), B; -B << 0,1,0, - 0,0,1, - 1,0,0; -cout << "At start, A = " << endl << A << endl; -A *= B; -cout << "After A *= B, A = " << endl << A << endl; -A.applyOnTheRight(B); // equivalent to A *= B -cout << "After applyOnTheRight, A = " << endl << A << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_array.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_array.cpp deleted file mode 100644 index f215086d..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_array.cpp +++ /dev/null @@ -1,4 +0,0 @@ -Vector3d v(1,2,3); -v.array() += 3; -v.array() -= 2; -cout << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_array_const.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_array_const.cpp deleted file mode 100644 index cd3b26a7..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_array_const.cpp +++ /dev/null @@ -1,4 +0,0 @@ -Vector3d v(-1,2,-3); -cout << "the absolute values:" << endl << v.array().abs() << endl; -cout << "the absolute values plus one:" << endl << v.array().abs()+1 << endl; -cout << "sum of the squares: " << v.array().square().sum() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_asDiagonal.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_asDiagonal.cpp deleted file mode 100644 index b01082db..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_asDiagonal.cpp +++ /dev/null @@ -1 +0,0 @@ -cout << Matrix3i(Vector3i(2,5,6).asDiagonal()) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_block_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_block_int_int.cpp deleted file mode 100644 index f99b6d4c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_block_int_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.block<2,2>(1,1):" << endl << m.block<2,2>(1,1) << endl; -m.block<2,2>(1,1).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_block_int_int_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_block_int_int_int_int.cpp deleted file mode 100644 index 7238cbbe..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_block_int_int_int_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.block(1, 1, 2, 2):" << endl << m.block(1, 1, 2, 2) << endl; -m.block(1, 1, 2, 2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomLeftCorner_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomLeftCorner_int_int.cpp deleted file mode 100644 index ebae95e1..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomLeftCorner_int_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.bottomLeftCorner(2, 2):" << endl; -cout << m.bottomLeftCorner(2, 2) << endl; -m.bottomLeftCorner(2, 2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomRightCorner_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomRightCorner_int_int.cpp deleted file mode 100644 index bf05093a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomRightCorner_int_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.bottomRightCorner(2, 2):" << endl; -cout << m.bottomRightCorner(2, 2) << endl; -m.bottomRightCorner(2, 2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomRows_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomRows_int.cpp deleted file mode 100644 index 47ca92ec..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_bottomRows_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Array44i a = Array44i::Random(); -cout << "Here is the array a:" << endl << a << endl; -cout << "Here is a.bottomRows(2):" << endl; -cout << a.bottomRows(2) << endl; -a.bottomRows(2).setZero(); -cout << "Now the array a is:" << endl << a << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cast.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cast.cpp deleted file mode 100644 index 016880b4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cast.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix2d md = Matrix2d::Identity() * 0.45; -Matrix2f mf = Matrix2f::Identity(); -cout << md + mf.cast() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_col.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_col.cpp deleted file mode 100644 index 87c91b12..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_col.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Identity(); -m.col(1) = Vector3d(4,5,6); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_colwise.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_colwise.cpp deleted file mode 100644 index a048beff..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_colwise.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the sum of each column:" << endl << m.colwise().sum() << endl; -cout << "Here is the maximum absolute value of each column:" - << endl << m.cwiseAbs().colwise().maxCoeff() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_computeInverseAndDetWithCheck.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_computeInverseAndDetWithCheck.cpp deleted file mode 100644 index a7b084fd..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_computeInverseAndDetWithCheck.cpp +++ /dev/null @@ -1,13 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -Matrix3d inverse; -bool invertible; -double determinant; -m.computeInverseAndDetWithCheck(inverse,determinant,invertible); -cout << "Its determinant is " << determinant << endl; -if(invertible) { - cout << "It is invertible, and its inverse is:" << endl << inverse << endl; -} -else { - cout << "It is not invertible." << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp deleted file mode 100644 index 873a9f87..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp +++ /dev/null @@ -1,11 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -Matrix3d inverse; -bool invertible; -m.computeInverseWithCheck(inverse,invertible); -if(invertible) { - cout << "It is invertible, and its inverse is:" << endl << inverse << endl; -} -else { - cout << "It is not invertible." << endl; -} diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseAbs.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseAbs.cpp deleted file mode 100644 index 28a31600..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseAbs.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXd m(2,3); -m << 2, -4, 6, - -5, 1, 0; -cout << m.cwiseAbs() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseAbs2.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseAbs2.cpp deleted file mode 100644 index 889a2e2b..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseAbs2.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXd m(2,3); -m << 2, -4, 6, - -5, 1, 0; -cout << m.cwiseAbs2() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseEqual.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseEqual.cpp deleted file mode 100644 index eb3656f4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseEqual.cpp +++ /dev/null @@ -1,7 +0,0 @@ -MatrixXi m(2,2); -m << 1, 0, - 1, 1; -cout << "Comparing m with identity matrix:" << endl; -cout << m.cwiseEqual(MatrixXi::Identity(2,2)) << endl; -int count = m.cwiseEqual(MatrixXi::Identity(2,2)).count(); -cout << "Number of coefficients that are equal: " << count << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseInverse.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseInverse.cpp deleted file mode 100644 index 23e08f7b..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseInverse.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXd m(2,3); -m << 2, 0.5, 1, - 3, 0.25, 1; -cout << m.cwiseInverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseMax.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseMax.cpp deleted file mode 100644 index 3c956818..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseMax.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Vector3d v(2,3,4), w(4,2,3); -cout << v.cwiseMax(w) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseMin.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseMin.cpp deleted file mode 100644 index 82fc761e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseMin.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Vector3d v(2,3,4), w(4,2,3); -cout << v.cwiseMin(w) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseNotEqual.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseNotEqual.cpp deleted file mode 100644 index 6a2e4fb6..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseNotEqual.cpp +++ /dev/null @@ -1,7 +0,0 @@ -MatrixXi m(2,2); -m << 1, 0, - 1, 1; -cout << "Comparing m with identity matrix:" << endl; -cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl; -int count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count(); -cout << "Number of coefficients that are not equal: " << count << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseProduct.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseProduct.cpp deleted file mode 100644 index 1db3a113..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseProduct.cpp +++ /dev/null @@ -1,4 +0,0 @@ -Matrix3i a = Matrix3i::Random(), b = Matrix3i::Random(); -Matrix3i c = a.cwiseProduct(b); -cout << "a:\n" << a << "\nb:\n" << b << "\nc:\n" << c << endl; - diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseQuotient.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseQuotient.cpp deleted file mode 100644 index 96912120..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseQuotient.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Vector3d v(2,3,4), w(4,2,3); -cout << v.cwiseQuotient(w) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseSqrt.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseSqrt.cpp deleted file mode 100644 index 4bfd75d5..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_cwiseSqrt.cpp +++ /dev/null @@ -1,2 +0,0 @@ -Vector3d v(1,2,4); -cout << v.cwiseSqrt() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal.cpp deleted file mode 100644 index cd63413f..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal.cpp +++ /dev/null @@ -1,4 +0,0 @@ -Matrix3i m = Matrix3i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here are the coefficients on the main diagonal of m:" << endl - << m.diagonal() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal_int.cpp deleted file mode 100644 index 7b66abf6..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here are the coefficients on the 1st super-diagonal and 2nd sub-diagonal of m:" << endl - << m.diagonal(1).transpose() << endl - << m.diagonal(-2).transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal_template_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal_template_int.cpp deleted file mode 100644 index 0e73d1c1..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_diagonal_template_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here are the coefficients on the 1st super-diagonal and 2nd sub-diagonal of m:" << endl - << m.diagonal<1>().transpose() << endl - << m.diagonal<-2>().transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_eigenvalues.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_eigenvalues.cpp deleted file mode 100644 index 039f8870..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_eigenvalues.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXd ones = MatrixXd::Ones(3,3); -VectorXcd eivals = ones.eigenvalues(); -cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << eivals << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_end_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_end_int.cpp deleted file mode 100644 index 03c54a93..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_end_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -RowVector4i v = RowVector4i::Random(); -cout << "Here is the vector v:" << endl << v << endl; -cout << "Here is v.tail(2):" << endl << v.tail(2) << endl; -v.tail(2).setZero(); -cout << "Now the vector v is:" << endl << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_eval.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_eval.cpp deleted file mode 100644 index 1df3aa01..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_eval.cpp +++ /dev/null @@ -1,12 +0,0 @@ -Matrix2f M = Matrix2f::Random(); -Matrix2f m; -m = M; -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Now we want to copy a column into a row." << endl; -cout << "If we do m.col(1) = m.row(0), then m becomes:" << endl; -m.col(1) = m.row(0); -cout << m << endl << "which is wrong!" << endl; -cout << "Now let us instead do m.col(1) = m.row(0).eval(). Then m becomes" << endl; -m = M; -m.col(1) = m.row(0).eval(); -cout << m << endl << "which is right." << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_extract.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_extract.cpp deleted file mode 100644 index c96220f7..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_extract.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _MSC_VER - #warning deprecated -#endif -/* deprecated -Matrix3i m = Matrix3i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the upper-triangular matrix extracted from m:" << endl - << m.part() << endl; -cout << "Here is the strictly-upper-triangular matrix extracted from m:" << endl - << m.part() << endl; -cout << "Here is the unit-lower-triangular matrix extracted from m:" << endl - << m.part() << endl; -*/ \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_fixedBlock_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_fixedBlock_int_int.cpp deleted file mode 100644 index 32011274..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_fixedBlock_int_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix4d m = Vector4d(1,2,3,4).asDiagonal(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.fixed<2, 2>(2, 2):" << endl << m.block<2, 2>(2, 2) << endl; -m.block<2, 2>(2, 0) = m.block<2, 2>(2, 2); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_identity.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_identity.cpp deleted file mode 100644 index b5c1e59c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_identity.cpp +++ /dev/null @@ -1 +0,0 @@ -cout << Matrix::Identity() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_identity_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_identity_int_int.cpp deleted file mode 100644 index 918649d6..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_identity_int_int.cpp +++ /dev/null @@ -1 +0,0 @@ -cout << MatrixXd::Identity(4, 3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_inverse.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_inverse.cpp deleted file mode 100644 index a56142ee..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_inverse.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Its inverse is:" << endl << m.inverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isDiagonal.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isDiagonal.cpp deleted file mode 100644 index 5b1d5997..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isDiagonal.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix3d m = 10000 * Matrix3d::Identity(); -m(0,2) = 1; -cout << "Here's the matrix m:" << endl << m << endl; -cout << "m.isDiagonal() returns: " << m.isDiagonal() << endl; -cout << "m.isDiagonal(1e-3) returns: " << m.isDiagonal(1e-3) << endl; - diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isIdentity.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isIdentity.cpp deleted file mode 100644 index 17b756c9..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isIdentity.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3d m = Matrix3d::Identity(); -m(0,2) = 1e-4; -cout << "Here's the matrix m:" << endl << m << endl; -cout << "m.isIdentity() returns: " << m.isIdentity() << endl; -cout << "m.isIdentity(1e-3) returns: " << m.isIdentity(1e-3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isOnes.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isOnes.cpp deleted file mode 100644 index f82f6280..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isOnes.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3d m = Matrix3d::Ones(); -m(0,2) += 1e-4; -cout << "Here's the matrix m:" << endl << m << endl; -cout << "m.isOnes() returns: " << m.isOnes() << endl; -cout << "m.isOnes(1e-3) returns: " << m.isOnes(1e-3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isOrthogonal.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isOrthogonal.cpp deleted file mode 100644 index b22af066..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isOrthogonal.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Vector3d v(1,0,0); -Vector3d w(1e-4,0,1); -cout << "Here's the vector v:" << endl << v << endl; -cout << "Here's the vector w:" << endl << w << endl; -cout << "v.isOrthogonal(w) returns: " << v.isOrthogonal(w) << endl; -cout << "v.isOrthogonal(w,1e-3) returns: " << v.isOrthogonal(w,1e-3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isUnitary.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isUnitary.cpp deleted file mode 100644 index 3877da34..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isUnitary.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3d m = Matrix3d::Identity(); -m(0,2) = 1e-4; -cout << "Here's the matrix m:" << endl << m << endl; -cout << "m.isUnitary() returns: " << m.isUnitary() << endl; -cout << "m.isUnitary(1e-3) returns: " << m.isUnitary(1e-3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isZero.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isZero.cpp deleted file mode 100644 index c2cfe220..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_isZero.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3d m = Matrix3d::Zero(); -m(0,2) = 1e-4; -cout << "Here's the matrix m:" << endl << m << endl; -cout << "m.isZero() returns: " << m.isZero() << endl; -cout << "m.isZero(1e-3) returns: " << m.isZero(1e-3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_leftCols_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_leftCols_int.cpp deleted file mode 100644 index 6ea984e4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_leftCols_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Array44i a = Array44i::Random(); -cout << "Here is the array a:" << endl << a << endl; -cout << "Here is a.leftCols(2):" << endl; -cout << a.leftCols(2) << endl; -a.leftCols(2).setZero(); -cout << "Now the array a is:" << endl << a << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_marked.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_marked.cpp deleted file mode 100644 index f6071217..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_marked.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _MSC_VER - #warning deprecated -#endif -/* -Matrix3d m = Matrix3d::Zero(); -m.part().setOnes(); -cout << "Here is the matrix m:" << endl << m << endl; -Matrix3d n = Matrix3d::Ones(); -n.part() *= 2; -cout << "Here is the matrix n:" << endl << n << endl; -cout << "And now here is m.inverse()*n, taking advantage of the fact that" - " m is upper-triangular:" << endl - << m.marked().solveTriangular(n); -*/ \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_noalias.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_noalias.cpp deleted file mode 100644 index 3b54a79a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_noalias.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix2d a, b, c; a << 1,2,3,4; b << 5,6,7,8; -c.noalias() = a * b; // this computes the product directly to c -cout << c << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones.cpp deleted file mode 100644 index 02c767c9..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones.cpp +++ /dev/null @@ -1,2 +0,0 @@ -cout << Matrix2d::Ones() << endl; -cout << 6 * RowVector4i::Ones() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones_int.cpp deleted file mode 100644 index 2ef188e7..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones_int.cpp +++ /dev/null @@ -1,2 +0,0 @@ -cout << 6 * RowVectorXi::Ones(4) << endl; -cout << VectorXf::Ones(2) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones_int_int.cpp deleted file mode 100644 index 60f5a31e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_ones_int_int.cpp +++ /dev/null @@ -1 +0,0 @@ -cout << MatrixXi::Ones(2,3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_operatorNorm.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_operatorNorm.cpp deleted file mode 100644 index 355246f0..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_operatorNorm.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXd ones = MatrixXd::Ones(3,3); -cout << "The operator norm of the 3x3 matrix of ones is " - << ones.operatorNorm() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_part.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_part.cpp deleted file mode 100644 index d3e7f482..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_part.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _MSC_VER - #warning deprecated -#endif -/* -Matrix3d m = Matrix3d::Zero(); -m.part().setOnes(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "And let us now compute m*m.adjoint() in a very optimized way" << endl - << "taking advantage of the symmetry." << endl; -Matrix3d n; -n.part() = (m*m.adjoint()).lazy(); -cout << "The result is:" << endl << n << endl; -*/ \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_prod.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_prod.cpp deleted file mode 100644 index d2f27bdc..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_prod.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the product of all the coefficients:" << endl << m.prod() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random.cpp deleted file mode 100644 index 65fc524f..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random.cpp +++ /dev/null @@ -1 +0,0 @@ -cout << 100 * Matrix2i::Random() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random_int.cpp deleted file mode 100644 index f161d03c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random_int.cpp +++ /dev/null @@ -1 +0,0 @@ -cout << VectorXi::Random(2) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random_int_int.cpp deleted file mode 100644 index 3f0f7dd5..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_random_int_int.cpp +++ /dev/null @@ -1 +0,0 @@ -cout << MatrixXi::Random(2,3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_replicate.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_replicate.cpp deleted file mode 100644 index 3ce52bcd..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_replicate.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXi m = MatrixXi::Random(2,3); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "m.replicate<3,2>() = ..." << endl; -cout << m.replicate<3,2>() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_replicate_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_replicate_int_int.cpp deleted file mode 100644 index b1dbc70b..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_replicate_int_int.cpp +++ /dev/null @@ -1,4 +0,0 @@ -Vector3i v = Vector3i::Random(); -cout << "Here is the vector v:" << endl << v << endl; -cout << "v.replicate(2,5) = ..." << endl; -cout << v.replicate(2,5) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_reverse.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_reverse.cpp deleted file mode 100644 index f545a283..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_reverse.cpp +++ /dev/null @@ -1,8 +0,0 @@ -MatrixXi m = MatrixXi::Random(3,4); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the reverse of m:" << endl << m.reverse() << endl; -cout << "Here is the coefficient (1,0) in the reverse of m:" << endl - << m.reverse()(1,0) << endl; -cout << "Let us overwrite this coefficient with the value 4." << endl; -m.reverse()(1,0) = 4; -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_rightCols_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_rightCols_int.cpp deleted file mode 100644 index cb513401..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_rightCols_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Array44i a = Array44i::Random(); -cout << "Here is the array a:" << endl << a << endl; -cout << "Here is a.rightCols(2):" << endl; -cout << a.rightCols(2) << endl; -a.rightCols(2).setZero(); -cout << "Now the array a is:" << endl << a << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_row.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_row.cpp deleted file mode 100644 index b15e6260..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_row.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Identity(); -m.row(1) = Vector3d(4,5,6); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_rowwise.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_rowwise.cpp deleted file mode 100644 index ae93964e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_rowwise.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the sum of each row:" << endl << m.rowwise().sum() << endl; -cout << "Here is the maximum absolute value of each row:" - << endl << m.cwiseAbs().rowwise().maxCoeff() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_segment_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_segment_int_int.cpp deleted file mode 100644 index 70cd6d26..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_segment_int_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -RowVector4i v = RowVector4i::Random(); -cout << "Here is the vector v:" << endl << v << endl; -cout << "Here is v.segment(1, 2):" << endl << v.segment(1, 2) << endl; -v.segment(1, 2).setZero(); -cout << "Now the vector v is:" << endl << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_select.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_select.cpp deleted file mode 100644 index ae5477f0..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_select.cpp +++ /dev/null @@ -1,6 +0,0 @@ -MatrixXi m(3, 3); -m << 1, 2, 3, - 4, 5, 6, - 7, 8, 9; -m = (m.array() >= 5).select(-m, m); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_set.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_set.cpp deleted file mode 100644 index 50ecf5fb..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_set.cpp +++ /dev/null @@ -1,13 +0,0 @@ -Matrix3i m1; -m1 << 1, 2, 3, - 4, 5, 6, - 7, 8, 9; -cout << m1 << endl << endl; -Matrix3i m2 = Matrix3i::Identity(); -m2.block(0,0, 2,2) << 10, 11, 12, 13; -cout << m2 << endl << endl; -Vector2i v1; -v1 << 14, 15; -m2 << v1.transpose(), 16, - v1, m1.block(1,1,2,2); -cout << m2 << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setIdentity.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setIdentity.cpp deleted file mode 100644 index 4fd0aa24..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setIdentity.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix4i m = Matrix4i::Zero(); -m.block<3,3>(1,0).setIdentity(); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setOnes.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setOnes.cpp deleted file mode 100644 index 4cef9c1e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setOnes.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -m.row(1).setOnes(); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setRandom.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setRandom.cpp deleted file mode 100644 index e2c257d4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setRandom.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix4i m = Matrix4i::Zero(); -m.col(1).setRandom(); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setZero.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setZero.cpp deleted file mode 100644 index 9b5b9583..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_setZero.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -m.row(1).setZero(); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_start_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_start_int.cpp deleted file mode 100644 index c261d2b4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_start_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -RowVector4i v = RowVector4i::Random(); -cout << "Here is the vector v:" << endl << v << endl; -cout << "Here is v.head(2):" << endl << v.head(2) << endl; -v.head(2).setZero(); -cout << "Now the vector v is:" << endl << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_bottomRows.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_bottomRows.cpp deleted file mode 100644 index f9ea892d..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_bottomRows.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Array44i a = Array44i::Random(); -cout << "Here is the array a:" << endl << a << endl; -cout << "Here is a.bottomRows<2>():" << endl; -cout << a.bottomRows<2>() << endl; -a.bottomRows<2>().setZero(); -cout << "Now the array a is:" << endl << a << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_end.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_end.cpp deleted file mode 100644 index f5ccb00f..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_end.cpp +++ /dev/null @@ -1,5 +0,0 @@ -RowVector4i v = RowVector4i::Random(); -cout << "Here is the vector v:" << endl << v << endl; -cout << "Here is v.tail(2):" << endl << v.tail<2>() << endl; -v.tail<2>().setZero(); -cout << "Now the vector v is:" << endl << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_block_int_int_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_block_int_int_int_int.cpp deleted file mode 100644 index 4dced03b..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_block_int_int_int_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the block:" << endl << m.block<2, Dynamic>(1, 1, 2, 3) << endl; -m.block<2, Dynamic>(1, 1, 2, 3).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp deleted file mode 100644 index 847892a2..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.bottomLeftCorner<2,2>():" << endl; -cout << m.bottomLeftCorner<2,2>() << endl; -m.bottomLeftCorner<2,2>().setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp deleted file mode 100644 index a1edcc80..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.bottomLeftCorner<2,Dynamic>(2,2):" << endl; -cout << m.bottomLeftCorner<2,Dynamic>(2,2) << endl; -m.bottomLeftCorner<2,Dynamic>(2,2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomRightCorner.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomRightCorner.cpp deleted file mode 100644 index abacb014..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomRightCorner.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.bottomRightCorner<2,2>():" << endl; -cout << m.bottomRightCorner<2,2>() << endl; -m.bottomRightCorner<2,2>().setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomRightCorner_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomRightCorner_int_int.cpp deleted file mode 100644 index a65508fd..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_bottomRightCorner_int_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.bottomRightCorner<2,Dynamic>(2,2):" << endl; -cout << m.bottomRightCorner<2,Dynamic>(2,2) << endl; -m.bottomRightCorner<2,Dynamic>(2,2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topLeftCorner.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topLeftCorner.cpp deleted file mode 100644 index 1899d902..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topLeftCorner.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.topLeftCorner<2,2>():" << endl; -cout << m.topLeftCorner<2,2>() << endl; -m.topLeftCorner<2,2>().setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp deleted file mode 100644 index fac761f6..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.topLeftCorner<2,Dynamic>(2,2):" << endl; -cout << m.topLeftCorner<2,Dynamic>(2,2) << endl; -m.topLeftCorner<2,Dynamic>(2,2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topRightCorner.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topRightCorner.cpp deleted file mode 100644 index c3a17711..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topRightCorner.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.topRightCorner<2,2>():" << endl; -cout << m.topRightCorner<2,2>() << endl; -m.topRightCorner<2,2>().setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp deleted file mode 100644 index a17acc00..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.topRightCorner<2,Dynamic>(2,2):" << endl; -cout << m.topRightCorner<2,Dynamic>(2,2) << endl; -m.topRightCorner<2,Dynamic>(2,2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_leftCols.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_leftCols.cpp deleted file mode 100644 index 1c425d91..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_leftCols.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Array44i a = Array44i::Random(); -cout << "Here is the array a:" << endl << a << endl; -cout << "Here is a.leftCols<2>():" << endl; -cout << a.leftCols<2>() << endl; -a.leftCols<2>().setZero(); -cout << "Now the array a is:" << endl << a << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_rightCols.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_rightCols.cpp deleted file mode 100644 index fc8c0d93..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_rightCols.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Array44i a = Array44i::Random(); -cout << "Here is the array a:" << endl << a << endl; -cout << "Here is a.rightCols<2>():" << endl; -cout << a.rightCols<2>() << endl; -a.rightCols<2>().setZero(); -cout << "Now the array a is:" << endl << a << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_segment.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_segment.cpp deleted file mode 100644 index e448b402..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_segment.cpp +++ /dev/null @@ -1,5 +0,0 @@ -RowVector4i v = RowVector4i::Random(); -cout << "Here is the vector v:" << endl << v << endl; -cout << "Here is v.segment<2>(1):" << endl << v.segment<2>(1) << endl; -v.segment<2>(2).setZero(); -cout << "Now the vector v is:" << endl << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_start.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_start.cpp deleted file mode 100644 index d336b371..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_start.cpp +++ /dev/null @@ -1,5 +0,0 @@ -RowVector4i v = RowVector4i::Random(); -cout << "Here is the vector v:" << endl << v << endl; -cout << "Here is v.head(2):" << endl << v.head<2>() << endl; -v.head<2>().setZero(); -cout << "Now the vector v is:" << endl << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_topRows.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_topRows.cpp deleted file mode 100644 index 0110251a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_template_int_topRows.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Array44i a = Array44i::Random(); -cout << "Here is the array a:" << endl << a << endl; -cout << "Here is a.topRows<2>():" << endl; -cout << a.topRows<2>() << endl; -a.topRows<2>().setZero(); -cout << "Now the array a is:" << endl << a << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topLeftCorner_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topLeftCorner_int_int.cpp deleted file mode 100644 index e52cb3bd..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topLeftCorner_int_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.topLeftCorner(2, 2):" << endl; -cout << m.topLeftCorner(2, 2) << endl; -m.topLeftCorner(2, 2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topRightCorner_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topRightCorner_int_int.cpp deleted file mode 100644 index 811fa563..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topRightCorner_int_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4i m = Matrix4i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is m.topRightCorner(2, 2):" << endl; -cout << m.topRightCorner(2, 2) << endl; -m.topRightCorner(2, 2).setZero(); -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topRows_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topRows_int.cpp deleted file mode 100644 index f2d75f1c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_topRows_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Array44i a = Array44i::Random(); -cout << "Here is the array a:" << endl << a << endl; -cout << "Here is a.topRows(2):" << endl; -cout << a.topRows(2) << endl; -a.topRows(2).setZero(); -cout << "Now the array a is:" << endl << a << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_transpose.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_transpose.cpp deleted file mode 100644 index 88eea83c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_transpose.cpp +++ /dev/null @@ -1,8 +0,0 @@ -Matrix2i m = Matrix2i::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the transpose of m:" << endl << m.transpose() << endl; -cout << "Here is the coefficient (1,0) in the transpose of m:" << endl - << m.transpose()(1,0) << endl; -cout << "Let us overwrite this coefficient with the value 0." << endl; -m.transpose()(1,0) = 0; -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero.cpp deleted file mode 100644 index 60649367..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero.cpp +++ /dev/null @@ -1,2 +0,0 @@ -cout << Matrix2d::Zero() << endl; -cout << RowVector4i::Zero() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero_int.cpp deleted file mode 100644 index 370a9ba0..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero_int.cpp +++ /dev/null @@ -1,2 +0,0 @@ -cout << RowVectorXi::Zero(4) << endl; -cout << VectorXf::Zero(2) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero_int_int.cpp deleted file mode 100644 index 4099c5d4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/MatrixBase_zero_int_int.cpp +++ /dev/null @@ -1 +0,0 @@ -cout << MatrixXi::Zero(2,3) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_NoChange_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_NoChange_int.cpp deleted file mode 100644 index acdf18c4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_NoChange_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXd m(3,4); -m.resize(NoChange, 5); -cout << "m: " << m.rows() << " rows, " << m.cols() << " cols" << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int.cpp deleted file mode 100644 index 044c7898..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int.cpp +++ /dev/null @@ -1,6 +0,0 @@ -VectorXd v(10); -v.resize(3); -RowVector3d w; -w.resize(3); // this is legal, but has no effect -cout << "v: " << v.rows() << " rows, " << v.cols() << " cols" << endl; -cout << "w: " << w.rows() << " rows, " << w.cols() << " cols" << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int_NoChange.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int_NoChange.cpp deleted file mode 100644 index 5c37c906..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int_NoChange.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXd m(3,4); -m.resize(5, NoChange); -cout << "m: " << m.rows() << " rows, " << m.cols() << " cols" << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int_int.cpp deleted file mode 100644 index bfd47415..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_resize_int_int.cpp +++ /dev/null @@ -1,9 +0,0 @@ -MatrixXd m(2,3); -m << 1,2,3,4,5,6; -cout << "here's the 2x3 matrix m:" << endl << m << endl; -cout << "let's resize m to 3x2. This is a conservative resizing because 2*3==3*2." << endl; -m.resize(3,2); -cout << "here's the 3x2 matrix m:" << endl << m << endl; -cout << "now let's resize m to size 2x2. This is NOT a conservative resizing, so it becomes uninitialized:" << endl; -m.resize(2,2); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setConstant_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setConstant_int.cpp deleted file mode 100644 index ff5a86c9..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setConstant_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -VectorXf v; -v.setConstant(3, 5); -cout << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setConstant_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setConstant_int_int.cpp deleted file mode 100644 index 32b950cf..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setConstant_int_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXf m; -m.setConstant(3, 3, 5); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setIdentity_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setIdentity_int_int.cpp deleted file mode 100644 index a6596719..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setIdentity_int_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXf m; -m.setIdentity(3, 3); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setOnes_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setOnes_int.cpp deleted file mode 100644 index 752cb35b..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setOnes_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -VectorXf v; -v.setOnes(3); -cout << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setOnes_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setOnes_int_int.cpp deleted file mode 100644 index 1ffb66bb..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setOnes_int_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXf m; -m.setOnes(3, 3); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setRandom_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setRandom_int.cpp deleted file mode 100644 index e160dd7d..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setRandom_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -VectorXf v; -v.setRandom(3); -cout << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setRandom_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setRandom_int_int.cpp deleted file mode 100644 index 80cda11d..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setRandom_int_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXf m; -m.setRandom(3, 3); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setZero_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setZero_int.cpp deleted file mode 100644 index 0fb16c1f..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setZero_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -VectorXf v; -v.setZero(3); -cout << v << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setZero_int_int.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setZero_int_int.cpp deleted file mode 100644 index ad883b91..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Matrix_setZero_int_int.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXf m; -m.setZero(3, 3); -cout << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/PartialPivLU_solve.cpp b/testbed/nanogui/ext/eigen/doc/snippets/PartialPivLU_solve.cpp deleted file mode 100644 index fa3570ab..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/PartialPivLU_solve.cpp +++ /dev/null @@ -1,7 +0,0 @@ -MatrixXd A = MatrixXd::Random(3,3); -MatrixXd B = MatrixXd::Random(3,2); -cout << "Here is the invertible matrix A:" << endl << A << endl; -cout << "Here is the matrix B:" << endl << B << endl; -MatrixXd X = A.lu().solve(B); -cout << "Here is the (unique) solution X to the equation AX=B:" << endl << X << endl; -cout << "Relative error: " << (A*X-B).norm() / B.norm() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_count.cpp b/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_count.cpp deleted file mode 100644 index c7b3097e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_count.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the count of elements larger or equal than 0.5 of each row:" << endl << (m.array() >= 0.5).rowwise().count() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_maxCoeff.cpp b/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_maxCoeff.cpp deleted file mode 100644 index e8fd3820..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_maxCoeff.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the maximum of each column:" << endl << m.colwise().maxCoeff() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_minCoeff.cpp b/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_minCoeff.cpp deleted file mode 100644 index d717bc0d..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_minCoeff.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the minimum of each column:" << endl << m.colwise().minCoeff() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_norm.cpp b/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_norm.cpp deleted file mode 100644 index dbcf290a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_norm.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the norm of each column:" << endl << m.colwise().norm() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_prod.cpp b/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_prod.cpp deleted file mode 100644 index aacf09cb..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_prod.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the product of each row:" << endl << m.rowwise().prod() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_squaredNorm.cpp b/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_squaredNorm.cpp deleted file mode 100644 index 9f3293e6..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_squaredNorm.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the square norm of each row:" << endl << m.rowwise().squaredNorm() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_sum.cpp b/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_sum.cpp deleted file mode 100644 index ec82d3e4..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/PartialRedux_sum.cpp +++ /dev/null @@ -1,3 +0,0 @@ -Matrix3d m = Matrix3d::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the sum of each row:" << endl << m.rowwise().sum() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/RealQZ_compute.cpp b/testbed/nanogui/ext/eigen/doc/snippets/RealQZ_compute.cpp deleted file mode 100644 index a18da42e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/RealQZ_compute.cpp +++ /dev/null @@ -1,17 +0,0 @@ -MatrixXf A = MatrixXf::Random(4,4); -MatrixXf B = MatrixXf::Random(4,4); -RealQZ qz(4); // preallocate space for 4x4 matrices -qz.compute(A,B); // A = Q S Z, B = Q T Z - -// print original matrices and result of decomposition -cout << "A:\n" << A << "\n" << "B:\n" << B << "\n"; -cout << "S:\n" << qz.matrixS() << "\n" << "T:\n" << qz.matrixT() << "\n"; -cout << "Q:\n" << qz.matrixQ() << "\n" << "Z:\n" << qz.matrixZ() << "\n"; - -// verify precision -cout << "\nErrors:" - << "\n|A-QSZ|: " << (A-qz.matrixQ()*qz.matrixS()*qz.matrixZ()).norm() - << ", |B-QTZ|: " << (B-qz.matrixQ()*qz.matrixT()*qz.matrixZ()).norm() - << "\n|QQ* - I|: " << (qz.matrixQ()*qz.matrixQ().adjoint() - MatrixXf::Identity(4,4)).norm() - << ", |ZZ* - I|: " << (qz.matrixZ()*qz.matrixZ().adjoint() - MatrixXf::Identity(4,4)).norm() - << "\n"; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/RealSchur_RealSchur_MatrixType.cpp b/testbed/nanogui/ext/eigen/doc/snippets/RealSchur_RealSchur_MatrixType.cpp deleted file mode 100644 index a5530dcc..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/RealSchur_RealSchur_MatrixType.cpp +++ /dev/null @@ -1,10 +0,0 @@ -MatrixXd A = MatrixXd::Random(6,6); -cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl; - -RealSchur schur(A); -cout << "The orthogonal matrix U is:" << endl << schur.matrixU() << endl; -cout << "The quasi-triangular matrix T is:" << endl << schur.matrixT() << endl << endl; - -MatrixXd U = schur.matrixU(); -MatrixXd T = schur.matrixT(); -cout << "U * T * U^T = " << endl << U * T * U.transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/RealSchur_compute.cpp b/testbed/nanogui/ext/eigen/doc/snippets/RealSchur_compute.cpp deleted file mode 100644 index 20c2611b..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/RealSchur_compute.cpp +++ /dev/null @@ -1,6 +0,0 @@ -MatrixXf A = MatrixXf::Random(4,4); -RealSchur schur(4); -schur.compute(A, /* computeU = */ false); -cout << "The matrix T in the decomposition of A is:" << endl << schur.matrixT() << endl; -schur.compute(A.inverse(), /* computeU = */ false); -cout << "The matrix T in the decomposition of A^(-1) is:" << endl << schur.matrixT() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp deleted file mode 100644 index 73a7f625..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver.cpp +++ /dev/null @@ -1,7 +0,0 @@ -SelfAdjointEigenSolver es; -Matrix4f X = Matrix4f::Random(4,4); -Matrix4f A = X + X.transpose(); -es.compute(A); -cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl; -es.compute(A + Matrix4f::Identity(4,4)); // re-use es to compute eigenvalues of A+I -cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp deleted file mode 100644 index 3599b17a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp +++ /dev/null @@ -1,17 +0,0 @@ -MatrixXd X = MatrixXd::Random(5,5); -MatrixXd A = X + X.transpose(); -cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl; - -SelfAdjointEigenSolver es(A); -cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl; -cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl; - -double lambda = es.eigenvalues()[0]; -cout << "Consider the first eigenvalue, lambda = " << lambda << endl; -VectorXd v = es.eigenvectors().col(0); -cout << "If v is the corresponding eigenvector, then lambda * v = " << endl << lambda * v << endl; -cout << "... and A * v = " << endl << A * v << endl << endl; - -MatrixXd D = es.eigenvalues().asDiagonal(); -MatrixXd V = es.eigenvectors(); -cout << "Finally, V * D * V^(-1) = " << endl << V * D * V.inverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp deleted file mode 100644 index bbb821e0..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp +++ /dev/null @@ -1,16 +0,0 @@ -MatrixXd X = MatrixXd::Random(5,5); -MatrixXd A = X + X.transpose(); -cout << "Here is a random symmetric matrix, A:" << endl << A << endl; -X = MatrixXd::Random(5,5); -MatrixXd B = X * X.transpose(); -cout << "and a random postive-definite matrix, B:" << endl << B << endl << endl; - -GeneralizedSelfAdjointEigenSolver es(A,B); -cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl; -cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl; - -double lambda = es.eigenvalues()[0]; -cout << "Consider the first eigenvalue, lambda = " << lambda << endl; -VectorXd v = es.eigenvectors().col(0); -cout << "If v is the corresponding eigenvector, then A * v = " << endl << A * v << endl; -cout << "... and lambda * B * v = " << endl << lambda * B * v << endl << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp deleted file mode 100644 index 2975cc3f..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp +++ /dev/null @@ -1,7 +0,0 @@ -SelfAdjointEigenSolver es(4); -MatrixXf X = MatrixXf::Random(4,4); -MatrixXf A = X + X.transpose(); -es.compute(A); -cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl; -es.compute(A + MatrixXf::Identity(4,4)); // re-use es to compute eigenvalues of A+I -cout << "The eigenvalues of A+I are: " << es.eigenvalues().transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp deleted file mode 100644 index 07c92a1e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp +++ /dev/null @@ -1,9 +0,0 @@ -MatrixXd X = MatrixXd::Random(5,5); -MatrixXd A = X * X.transpose(); -X = MatrixXd::Random(5,5); -MatrixXd B = X * X.transpose(); - -GeneralizedSelfAdjointEigenSolver es(A,B,EigenvaluesOnly); -cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl; -es.compute(B,A,false); -cout << "The eigenvalues of the pencil (B,A) are:" << endl << es.eigenvalues() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_eigenvalues.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_eigenvalues.cpp deleted file mode 100644 index 0ff33c68..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_eigenvalues.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXd ones = MatrixXd::Ones(3,3); -SelfAdjointEigenSolver es(ones); -cout << "The eigenvalues of the 3x3 matrix of ones are:" - << endl << es.eigenvalues() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_eigenvectors.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_eigenvectors.cpp deleted file mode 100644 index cfc8b0d5..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_eigenvectors.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXd ones = MatrixXd::Ones(3,3); -SelfAdjointEigenSolver es(ones); -cout << "The first eigenvector of the 3x3 matrix of ones is:" - << endl << es.eigenvectors().col(1) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_operatorInverseSqrt.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_operatorInverseSqrt.cpp deleted file mode 100644 index 114c65fb..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_operatorInverseSqrt.cpp +++ /dev/null @@ -1,9 +0,0 @@ -MatrixXd X = MatrixXd::Random(4,4); -MatrixXd A = X * X.transpose(); -cout << "Here is a random positive-definite matrix, A:" << endl << A << endl << endl; - -SelfAdjointEigenSolver es(A); -cout << "The inverse square root of A is: " << endl; -cout << es.operatorInverseSqrt() << endl; -cout << "We can also compute it with operatorSqrt() and inverse(). That yields: " << endl; -cout << es.operatorSqrt().inverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_operatorSqrt.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_operatorSqrt.cpp deleted file mode 100644 index eeacca74..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointEigenSolver_operatorSqrt.cpp +++ /dev/null @@ -1,8 +0,0 @@ -MatrixXd X = MatrixXd::Random(4,4); -MatrixXd A = X * X.transpose(); -cout << "Here is a random positive-definite matrix, A:" << endl << A << endl << endl; - -SelfAdjointEigenSolver es(A); -MatrixXd sqrtA = es.operatorSqrt(); -cout << "The square root of A is: " << endl << sqrtA << endl; -cout << "If we square this, we get: " << endl << sqrtA*sqrtA << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointView_eigenvalues.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointView_eigenvalues.cpp deleted file mode 100644 index be198677..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointView_eigenvalues.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXd ones = MatrixXd::Ones(3,3); -VectorXd eivals = ones.selfadjointView().eigenvalues(); -cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << eivals << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointView_operatorNorm.cpp b/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointView_operatorNorm.cpp deleted file mode 100644 index f380f559..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/SelfAdjointView_operatorNorm.cpp +++ /dev/null @@ -1,3 +0,0 @@ -MatrixXd ones = MatrixXd::Ones(3,3); -cout << "The operator norm of the 3x3 matrix of ones is " - << ones.selfadjointView().operatorNorm() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_block.cpp b/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_block.cpp deleted file mode 100644 index 03282f4f..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_block.cpp +++ /dev/null @@ -1,7 +0,0 @@ -MatrixXi mat(3,3); -mat << 1, 2, 3, 4, 5, 6, 7, 8, 9; -cout << "Here is the matrix mat:\n" << mat << endl; - -// This assignment shows the aliasing problem -mat.bottomRightCorner(2,2) = mat.topLeftCorner(2,2); -cout << "After the assignment, mat = \n" << mat << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_block_correct.cpp b/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_block_correct.cpp deleted file mode 100644 index 6fee5801..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_block_correct.cpp +++ /dev/null @@ -1,7 +0,0 @@ -MatrixXi mat(3,3); -mat << 1, 2, 3, 4, 5, 6, 7, 8, 9; -cout << "Here is the matrix mat:\n" << mat << endl; - -// The eval() solves the aliasing problem -mat.bottomRightCorner(2,2) = mat.topLeftCorner(2,2).eval(); -cout << "After the assignment, mat = \n" << mat << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_cwise.cpp b/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_cwise.cpp deleted file mode 100644 index 7049f6c5..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_cwise.cpp +++ /dev/null @@ -1,20 +0,0 @@ -MatrixXf mat(2,2); -mat << 1, 2, 4, 7; -cout << "Here is the matrix mat:\n" << mat << endl << endl; - -mat = 2 * mat; -cout << "After 'mat = 2 * mat', mat = \n" << mat << endl << endl; - - -mat = mat - MatrixXf::Identity(2,2); -cout << "After the subtraction, it becomes\n" << mat << endl << endl; - - -ArrayXXf arr = mat; -arr = arr.square(); -cout << "After squaring, it becomes\n" << arr << endl << endl; - -// Combining all operations in one statement: -mat << 1, 2, 4, 7; -mat = (2 * mat - MatrixXf::Identity(2,2)).array().square(); -cout << "Doing everything at once yields\n" << mat << endl << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult1.cpp b/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult1.cpp deleted file mode 100644 index cd7e9004..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult1.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXf matA(2,2); -matA << 2, 0, 0, 2; -matA = matA * matA; -cout << matA; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult2.cpp b/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult2.cpp deleted file mode 100644 index a3ff5685..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult2.cpp +++ /dev/null @@ -1,10 +0,0 @@ -MatrixXf matA(2,2), matB(2,2); -matA << 2, 0, 0, 2; - -// Simple but not quite as efficient -matB = matA * matA; -cout << matB << endl << endl; - -// More complicated but also more efficient -matB.noalias() = matA * matA; -cout << matB; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult3.cpp b/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult3.cpp deleted file mode 100644 index 1d12a6c6..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/TopicAliasing_mult3.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXf matA(2,2); -matA << 2, 0, 0, 2; -matA.noalias() = matA * matA; -cout << matA; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/TopicStorageOrders_example.cpp b/testbed/nanogui/ext/eigen/doc/snippets/TopicStorageOrders_example.cpp deleted file mode 100644 index 0623ef0c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/TopicStorageOrders_example.cpp +++ /dev/null @@ -1,18 +0,0 @@ -Matrix Acolmajor; -Acolmajor << 8, 2, 2, 9, - 9, 1, 4, 4, - 3, 5, 4, 5; -cout << "The matrix A:" << endl; -cout << Acolmajor << endl << endl; - -cout << "In memory (column-major):" << endl; -for (int i = 0; i < Acolmajor.size(); i++) - cout << *(Acolmajor.data() + i) << " "; -cout << endl << endl; - -Matrix Arowmajor = Acolmajor; -cout << "In memory (row-major):" << endl; -for (int i = 0; i < Arowmajor.size(); i++) - cout << *(Arowmajor.data() + i) << " "; -cout << endl; - diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_Tridiagonalization_MatrixType.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_Tridiagonalization_MatrixType.cpp deleted file mode 100644 index a2601243..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_Tridiagonalization_MatrixType.cpp +++ /dev/null @@ -1,9 +0,0 @@ -MatrixXd X = MatrixXd::Random(5,5); -MatrixXd A = X + X.transpose(); -cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl; -Tridiagonalization triOfA(A); -MatrixXd Q = triOfA.matrixQ(); -cout << "The orthogonal matrix Q is:" << endl << Q << endl; -MatrixXd T = triOfA.matrixT(); -cout << "The tridiagonal matrix T is:" << endl << T << endl << endl; -cout << "Q * T * Q^T = " << endl << Q * T * Q.transpose() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_compute.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_compute.cpp deleted file mode 100644 index 0062a99e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_compute.cpp +++ /dev/null @@ -1,9 +0,0 @@ -Tridiagonalization tri; -MatrixXf X = MatrixXf::Random(4,4); -MatrixXf A = X + X.transpose(); -tri.compute(A); -cout << "The matrix T in the tridiagonal decomposition of A is: " << endl; -cout << tri.matrixT() << endl; -tri.compute(2*A); // re-use tri to compute eigenvalues of 2A -cout << "The matrix T in the tridiagonal decomposition of 2A is: " << endl; -cout << tri.matrixT() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_decomposeInPlace.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_decomposeInPlace.cpp deleted file mode 100644 index 93dcfca1..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_decomposeInPlace.cpp +++ /dev/null @@ -1,10 +0,0 @@ -MatrixXd X = MatrixXd::Random(5,5); -MatrixXd A = X + X.transpose(); -cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl; - -VectorXd diag(5); -VectorXd subdiag(4); -internal::tridiagonalization_inplace(A, diag, subdiag, true); -cout << "The orthogonal matrix Q is:" << endl << A << endl; -cout << "The diagonal of the tridiagonal matrix T is:" << endl << diag << endl; -cout << "The subdiagonal of the tridiagonal matrix T is:" << endl << subdiag << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_diagonal.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_diagonal.cpp deleted file mode 100644 index 6eec8216..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_diagonal.cpp +++ /dev/null @@ -1,13 +0,0 @@ -MatrixXcd X = MatrixXcd::Random(4,4); -MatrixXcd A = X + X.adjoint(); -cout << "Here is a random self-adjoint 4x4 matrix:" << endl << A << endl << endl; - -Tridiagonalization triOfA(A); -MatrixXd T = triOfA.matrixT(); -cout << "The tridiagonal matrix T is:" << endl << T << endl << endl; - -cout << "We can also extract the diagonals of T directly ..." << endl; -VectorXd diag = triOfA.diagonal(); -cout << "The diagonal is:" << endl << diag << endl; -VectorXd subdiag = triOfA.subDiagonal(); -cout << "The subdiagonal is:" << endl << subdiag << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_householderCoefficients.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_householderCoefficients.cpp deleted file mode 100644 index e5d87288..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_householderCoefficients.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix4d X = Matrix4d::Random(4,4); -Matrix4d A = X + X.transpose(); -cout << "Here is a random symmetric 4x4 matrix:" << endl << A << endl; -Tridiagonalization triOfA(A); -Vector3d hc = triOfA.householderCoefficients(); -cout << "The vector of Householder coefficients is:" << endl << hc << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_packedMatrix.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_packedMatrix.cpp deleted file mode 100644 index 0f55d0c2..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tridiagonalization_packedMatrix.cpp +++ /dev/null @@ -1,8 +0,0 @@ -Matrix4d X = Matrix4d::Random(4,4); -Matrix4d A = X + X.transpose(); -cout << "Here is a random symmetric 4x4 matrix:" << endl << A << endl; -Tridiagonalization triOfA(A); -Matrix4d pm = triOfA.packedMatrix(); -cout << "The packed matrix M is:" << endl << pm << endl; -cout << "The diagonal and subdiagonal corresponds to the matrix T, which is:" - << endl << triOfA.matrixT() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Block.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Block.cpp deleted file mode 100644 index 96e40acf..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Block.cpp +++ /dev/null @@ -1,5 +0,0 @@ -MatrixXf matA(2, 2); -matA << 1, 2, 3, 4; -MatrixXf matB(4, 4); -matB << matA, matA/10, matA/10, matA; -std::cout << matB << std::endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_CommaTemporary.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_CommaTemporary.cpp deleted file mode 100644 index 50cff4cb..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_CommaTemporary.cpp +++ /dev/null @@ -1,4 +0,0 @@ -MatrixXf mat = MatrixXf::Random(2, 3); -std::cout << mat << std::endl << std::endl; -mat = (MatrixXf(2,2) << 0, 1, 1, 0).finished() * mat; -std::cout << mat << std::endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp deleted file mode 100644 index 84e8715c..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp +++ /dev/null @@ -1,11 +0,0 @@ -RowVectorXd vec1(3); -vec1 << 1, 2, 3; -std::cout << "vec1 = " << vec1 << std::endl; - -RowVectorXd vec2(4); -vec2 << 1, 4, 9, 16;; -std::cout << "vec2 = " << vec2 << std::endl; - -RowVectorXd joined(7); -joined << vec1, vec2; -std::cout << "joined = " << joined << std::endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_LinSpaced.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_LinSpaced.cpp deleted file mode 100644 index c6a73ab8..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_LinSpaced.cpp +++ /dev/null @@ -1,7 +0,0 @@ -ArrayXXf table(10, 4); -table.col(0) = ArrayXf::LinSpaced(10, 0, 90); -table.col(1) = M_PI / 180 * table.col(0); -table.col(2) = table.col(1).sin(); -table.col(3) = table.col(1).cos(); -std::cout << " Degrees Radians Sine Cosine\n"; -std::cout << table << std::endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_ThreeWays.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_ThreeWays.cpp deleted file mode 100644 index cb745765..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_ThreeWays.cpp +++ /dev/null @@ -1,20 +0,0 @@ -const int size = 6; -MatrixXd mat1(size, size); -mat1.topLeftCorner(size/2, size/2) = MatrixXd::Zero(size/2, size/2); -mat1.topRightCorner(size/2, size/2) = MatrixXd::Identity(size/2, size/2); -mat1.bottomLeftCorner(size/2, size/2) = MatrixXd::Identity(size/2, size/2); -mat1.bottomRightCorner(size/2, size/2) = MatrixXd::Zero(size/2, size/2); -std::cout << mat1 << std::endl << std::endl; - -MatrixXd mat2(size, size); -mat2.topLeftCorner(size/2, size/2).setZero(); -mat2.topRightCorner(size/2, size/2).setIdentity(); -mat2.bottomLeftCorner(size/2, size/2).setIdentity(); -mat2.bottomRightCorner(size/2, size/2).setZero(); -std::cout << mat2 << std::endl << std::endl; - -MatrixXd mat3(size, size); -mat3 << MatrixXd::Zero(size/2, size/2), MatrixXd::Identity(size/2, size/2), - MatrixXd::Identity(size/2, size/2), MatrixXd::Zero(size/2, size/2); -std::cout << mat3 << std::endl; - diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp deleted file mode 100644 index 76a36a31..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp +++ /dev/null @@ -1,13 +0,0 @@ -std::cout << "A fixed-size array:\n"; -Array33f a1 = Array33f::Zero(); -std::cout << a1 << "\n\n"; - - -std::cout << "A one-dimensional dynamic-size array:\n"; -ArrayXf a2 = ArrayXf::Zero(3); -std::cout << a2 << "\n\n"; - - -std::cout << "A two-dimensional dynamic-size array:\n"; -ArrayXXf a3 = ArrayXXf::Zero(3, 4); -std::cout << a3 << "\n"; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_Map_rowmajor.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_Map_rowmajor.cpp deleted file mode 100644 index fd45ace0..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_Map_rowmajor.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int array[8]; -for(int i = 0; i < 8; ++i) array[i] = i; -cout << "Column-major:\n" << Map >(array) << endl; -cout << "Row-major:\n" << Map >(array) << endl; -cout << "Row-major using stride:\n" << - Map, Unaligned, Stride<1,4> >(array) << endl; - diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_Map_using.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_Map_using.cpp deleted file mode 100644 index e5e499f1..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_Map_using.cpp +++ /dev/null @@ -1,21 +0,0 @@ -typedef Matrix MatrixType; -typedef Map MapType; -typedef Map MapTypeConst; // a read-only map -const int n_dims = 5; - -MatrixType m1(n_dims), m2(n_dims); -m1.setRandom(); -m2.setRandom(); -float *p = &m2(0); // get the address storing the data for m2 -MapType m2map(p,m2.size()); // m2map shares data with m2 -MapTypeConst m2mapconst(p,m2.size()); // a read-only accessor for m2 - -cout << "m1: " << m1 << endl; -cout << "m2: " << m2 << endl; -cout << "Squared euclidean distance: " << (m1-m2).squaredNorm() << endl; -cout << "Squared euclidean distance, using map: " << - (m1-m2map).squaredNorm() << endl; -m2map(3) = 7; // this will change m2, since they share the same array -cout << "Updated m2: " << m2 << endl; -cout << "m2 coefficient 2, constant accessor: " << m2mapconst(2) << endl; -/* m2mapconst(2) = 5; */ // this yields a compile-time error diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_01.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_01.cpp deleted file mode 100644 index 47ba31dc..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_01.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3f m; -m << 1, 2, 3, - 4, 5, 6, - 7, 8, 9; -std::cout << m; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_01b.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_01b.cpp deleted file mode 100644 index 2adb2e21..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_01b.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix3f m; -m.row(0) << 1, 2, 3; -m.block(1,0,2,2) << 4, 5, 7, 8; -m.col(2).tail(2) << 6, 9; -std::cout << m; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_02.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_02.cpp deleted file mode 100644 index c960d6ab..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_commainit_02.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int rows=5, cols=5; -MatrixXf m(rows,cols); -m << (Matrix3f() << 1, 2, 3, 4, 5, 6, 7, 8, 9).finished(), - MatrixXf::Zero(3,cols-3), - MatrixXf::Zero(rows-3,3), - MatrixXf::Identity(rows-3,cols-3); -cout << m; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_matrix_inverse.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_matrix_inverse.cpp deleted file mode 100644 index fff32444..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_matrix_inverse.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix3f A; -Vector3f b; -A << 1,2,3, 4,5,6, 7,8,10; -b << 3, 3, 4; -Vector3f x = A.inverse() * b; -cout << "The solution is:" << endl << x << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_multiple_rhs.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_multiple_rhs.cpp deleted file mode 100644 index 5411a44a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_multiple_rhs.cpp +++ /dev/null @@ -1,10 +0,0 @@ -Matrix3f A(3,3); -A << 1,2,3, 4,5,6, 7,8,10; -Matrix B; -B << 3,1, 3,1, 4,1; -Matrix X; -X = A.fullPivLu().solve(B); -cout << "The solution with right-hand side (3,3,4) is:" << endl; -cout << X.col(0) << endl; -cout << "The solution with right-hand side (1,1,1) is:" << endl; -cout << X.col(1) << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_reuse_decomposition.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_reuse_decomposition.cpp deleted file mode 100644 index 3ca06453..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_reuse_decomposition.cpp +++ /dev/null @@ -1,13 +0,0 @@ -Matrix3f A(3,3); -A << 1,2,3, 4,5,6, 7,8,10; -PartialPivLU luOfA(A); // compute LU decomposition of A -Vector3f b; -b << 3,3,4; -Vector3f x; -x = luOfA.solve(b); -cout << "The solution with right-hand side (3,3,4) is:" << endl; -cout << x << endl; -b << 1,1,1; -x = luOfA.solve(b); -cout << "The solution with right-hand side (1,1,1) is:" << endl; -cout << x << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_singular.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_singular.cpp deleted file mode 100644 index abff1ef7..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_singular.cpp +++ /dev/null @@ -1,9 +0,0 @@ -Matrix3f A; -Vector3f b; -A << 1,2,3, 4,5,6, 7,8,9; -b << 3, 3, 4; -cout << "Here is the matrix A:" << endl << A << endl; -cout << "Here is the vector b:" << endl << b << endl; -Vector3f x; -x = A.lu().solve(b); -cout << "The solution is:" << endl << x << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_triangular.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_triangular.cpp deleted file mode 100644 index 9d13f22e..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_triangular.cpp +++ /dev/null @@ -1,8 +0,0 @@ -Matrix3f A; -Vector3f b; -A << 1,2,3, 0,5,6, 0,0,10; -b << 3, 3, 4; -cout << "Here is the matrix A:" << endl << A << endl; -cout << "Here is the vector b:" << endl << b << endl; -Vector3f x = A.triangularView().solve(b); -cout << "The solution is:" << endl << x << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_triangular_inplace.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_triangular_inplace.cpp deleted file mode 100644 index 16ae633a..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Tutorial_solve_triangular_inplace.cpp +++ /dev/null @@ -1,6 +0,0 @@ -Matrix3f A; -Vector3f b; -A << 1,2,3, 0,5,6, 0,0,10; -b << 3, 3, 4; -A.triangularView().solveInPlace(b); -cout << "The solution is:" << endl << b << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/Vectorwise_reverse.cpp b/testbed/nanogui/ext/eigen/doc/snippets/Vectorwise_reverse.cpp deleted file mode 100644 index 2f6a3508..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/Vectorwise_reverse.cpp +++ /dev/null @@ -1,10 +0,0 @@ -MatrixXi m = MatrixXi::Random(3,4); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "Here is the rowwise reverse of m:" << endl << m.rowwise().reverse() << endl; -cout << "Here is the colwise reverse of m:" << endl << m.colwise().reverse() << endl; - -cout << "Here is the coefficient (1,0) in the rowise reverse of m:" << endl -<< m.rowwise().reverse()(1,0) << endl; -cout << "Let us overwrite this coefficient with the value 4." << endl; -//m.colwise().reverse()(1,0) = 4; -cout << "Now the matrix m is:" << endl << m << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/class_FullPivLU.cpp b/testbed/nanogui/ext/eigen/doc/snippets/class_FullPivLU.cpp deleted file mode 100644 index fce7fac0..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/class_FullPivLU.cpp +++ /dev/null @@ -1,16 +0,0 @@ -typedef Matrix Matrix5x3; -typedef Matrix Matrix5x5; -Matrix5x3 m = Matrix5x3::Random(); -cout << "Here is the matrix m:" << endl << m << endl; -Eigen::FullPivLU lu(m); -cout << "Here is, up to permutations, its LU decomposition matrix:" - << endl << lu.matrixLU() << endl; -cout << "Here is the L part:" << endl; -Matrix5x5 l = Matrix5x5::Identity(); -l.block<5,3>(0,0).triangularView() = lu.matrixLU(); -cout << l << endl; -cout << "Here is the U part:" << endl; -Matrix5x3 u = lu.matrixLU().triangularView(); -cout << u << endl; -cout << "Let us now reconstruct the original matrix m:" << endl; -cout << lu.permutationP().inverse() * l * u * lu.permutationQ().inverse() << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/compile_snippet.cpp.in b/testbed/nanogui/ext/eigen/doc/snippets/compile_snippet.cpp.in deleted file mode 100644 index 894cd526..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/compile_snippet.cpp.in +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -using namespace Eigen; -using namespace std; - -int main(int, char**) -{ - cout.precision(3); - ${snippet_source_code} - return 0; -} diff --git a/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_redux_minmax.cpp b/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_redux_minmax.cpp deleted file mode 100644 index f4ae7f40..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_redux_minmax.cpp +++ /dev/null @@ -1,12 +0,0 @@ - Matrix3f m = Matrix3f::Random(); - std::ptrdiff_t i, j; - float minOfM = m.minCoeff(&i,&j); - cout << "Here is the matrix m:\n" << m << endl; - cout << "Its minimum coefficient (" << minOfM - << ") is at position (" << i << "," << j << ")\n\n"; - - RowVector4i v = RowVector4i::Random(); - int maxOfV = v.maxCoeff(&i); - cout << "Here is the vector v: " << v << endl; - cout << "Its maximum coefficient (" << maxOfV - << ") is at position " << i << endl; diff --git a/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_aliasing.cpp b/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_aliasing.cpp deleted file mode 100644 index c8e4746d..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_aliasing.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix2i a; a << 1, 2, 3, 4; -cout << "Here is the matrix a:\n" << a << endl; - -a = a.transpose(); // !!! do NOT do this !!! -cout << "and the result of the aliasing effect:\n" << a << endl; \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_conjugate.cpp b/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_conjugate.cpp deleted file mode 100644 index 88496b22..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_conjugate.cpp +++ /dev/null @@ -1,12 +0,0 @@ -MatrixXcf a = MatrixXcf::Random(2,2); -cout << "Here is the matrix a\n" << a << endl; - -cout << "Here is the matrix a^T\n" << a.transpose() << endl; - - -cout << "Here is the conjugate of a\n" << a.conjugate() << endl; - - -cout << "Here is the matrix a^*\n" << a.adjoint() << endl; - - diff --git a/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_inplace.cpp b/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_inplace.cpp deleted file mode 100644 index 7a069ff2..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/tut_arithmetic_transpose_inplace.cpp +++ /dev/null @@ -1,6 +0,0 @@ -MatrixXf a(2,3); a << 1, 2, 3, 4, 5, 6; -cout << "Here is the initial matrix a:\n" << a << endl; - - -a.transposeInPlace(); -cout << "and after being transposed:\n" << a << endl; \ No newline at end of file diff --git a/testbed/nanogui/ext/eigen/doc/snippets/tut_matrix_assignment_resizing.cpp b/testbed/nanogui/ext/eigen/doc/snippets/tut_matrix_assignment_resizing.cpp deleted file mode 100644 index cf189983..00000000 --- a/testbed/nanogui/ext/eigen/doc/snippets/tut_matrix_assignment_resizing.cpp +++ /dev/null @@ -1,5 +0,0 @@ -MatrixXf a(2,2); -std::cout << "a is of size " << a.rows() << "x" << a.cols() << std::endl; -MatrixXf b(3,3); -a = b; -std::cout << "a is now of size " << a.rows() << "x" << a.cols() << std::endl; diff --git a/testbed/nanogui/ext/eigen/doc/special_examples/CMakeLists.txt b/testbed/nanogui/ext/eigen/doc/special_examples/CMakeLists.txt deleted file mode 100644 index f8a0148c..00000000 --- a/testbed/nanogui/ext/eigen/doc/special_examples/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -if(NOT EIGEN_TEST_NOQT) - find_package(Qt4) - if(QT4_FOUND) - include(${QT_USE_FILE}) - endif() -endif(NOT EIGEN_TEST_NOQT) - -if(QT4_FOUND) - add_executable(Tutorial_sparse_example Tutorial_sparse_example.cpp Tutorial_sparse_example_details.cpp) - target_link_libraries(Tutorial_sparse_example ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) - - add_custom_command( - TARGET Tutorial_sparse_example - POST_BUILD - COMMAND Tutorial_sparse_example ARGS ${CMAKE_CURRENT_BINARY_DIR}/../html/Tutorial_sparse_example.jpeg - ) - - add_dependencies(all_examples Tutorial_sparse_example) -endif(QT4_FOUND) - diff --git a/testbed/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example.cpp b/testbed/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example.cpp deleted file mode 100644 index 002f19f0..00000000 --- a/testbed/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include - -typedef Eigen::SparseMatrix SpMat; // declares a column-major sparse matrix type of double -typedef Eigen::Triplet T; - -void buildProblem(std::vector& coefficients, Eigen::VectorXd& b, int n); -void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* filename); - -int main(int argc, char** argv) -{ - int n = 300; // size of the image - int m = n*n; // number of unknows (=number of pixels) - - // Assembly: - std::vector coefficients; // list of non-zeros coefficients - Eigen::VectorXd b(m); // the right hand side-vector resulting from the constraints - buildProblem(coefficients, b, n); - - SpMat A(m,m); - A.setFromTriplets(coefficients.begin(), coefficients.end()); - - // Solving: - Eigen::SimplicialCholesky chol(A); // performs a Cholesky factorization of A - Eigen::VectorXd x = chol.solve(b); // use the factorization to solve for the given right hand side - - // Export the result to a file: - saveAsBitmap(x, n, argv[1]); - - return 0; -} - diff --git a/testbed/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example_details.cpp b/testbed/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example_details.cpp deleted file mode 100644 index 7d820b44..00000000 --- a/testbed/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example_details.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include -#include - -typedef Eigen::SparseMatrix SpMat; // declares a column-major sparse matrix type of double -typedef Eigen::Triplet T; - -void insertCoefficient(int id, int i, int j, double w, std::vector& coeffs, - Eigen::VectorXd& b, const Eigen::VectorXd& boundary) -{ - int n = boundary.size(); - int id1 = i+j*n; - - if(i==-1 || i==n) b(id) -= w * boundary(j); // constrained coefficient - else if(j==-1 || j==n) b(id) -= w * boundary(i); // constrained coefficient - else coeffs.push_back(T(id,id1,w)); // unknown coefficient -} - -void buildProblem(std::vector& coefficients, Eigen::VectorXd& b, int n) -{ - b.setZero(); - Eigen::ArrayXd boundary = Eigen::ArrayXd::LinSpaced(n, 0,M_PI).sin().pow(2); - for(int j=0; j bits = (x*255).cast(); - QImage img(bits.data(), n,n,QImage::Format_Indexed8); - img.setColorCount(256); - for(int i=0;i<256;i++) img.setColor(i,qRgb(i,i,i)); - img.save(filename); -} diff --git a/testbed/nanogui/ext/eigen/doc/tutorial.cpp b/testbed/nanogui/ext/eigen/doc/tutorial.cpp deleted file mode 100644 index 62be7c27..00000000 --- a/testbed/nanogui/ext/eigen/doc/tutorial.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include - -int main(int argc, char *argv[]) -{ - std::cout.precision(2); - - // demo static functions - Eigen::Matrix3f m3 = Eigen::Matrix3f::Random(); - Eigen::Matrix4f m4 = Eigen::Matrix4f::Identity(); - - std::cout << "*** Step 1 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl; - - // demo non-static set... functions - m4.setZero(); - m3.diagonal().setOnes(); - - std::cout << "*** Step 2 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl; - - // demo fixed-size block() expression as lvalue and as rvalue - m4.block<3,3>(0,1) = m3; - m3.row(2) = m4.block<1,3>(2,0); - - std::cout << "*** Step 3 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl; - - // demo dynamic-size block() - { - int rows = 3, cols = 3; - m4.block(0,1,3,3).setIdentity(); - std::cout << "*** Step 4 ***\nm4:\n" << m4 << std::endl; - } - - // demo vector blocks - m4.diagonal().block(1,2).setOnes(); - std::cout << "*** Step 5 ***\nm4.diagonal():\n" << m4.diagonal() << std::endl; - std::cout << "m4.diagonal().start(3)\n" << m4.diagonal().start(3) << std::endl; - - // demo coeff-wise operations - m4 = m4.cwise()*m4; - m3 = m3.cwise().cos(); - std::cout << "*** Step 6 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl; - - // sums of coefficients - std::cout << "*** Step 7 ***\n m4.sum(): " << m4.sum() << std::endl; - std::cout << "m4.col(2).sum(): " << m4.col(2).sum() << std::endl; - std::cout << "m4.colwise().sum():\n" << m4.colwise().sum() << std::endl; - std::cout << "m4.rowwise().sum():\n" << m4.rowwise().sum() << std::endl; - - // demo intelligent auto-evaluation - m4 = m4 * m4; // auto-evaluates so no aliasing problem (performance penalty is low) - Eigen::Matrix4f other = (m4 * m4).lazy(); // forces lazy evaluation - m4 = m4 + m4; // here Eigen goes for lazy evaluation, as with most expressions - m4 = -m4 + m4 + 5 * m4; // same here, Eigen chooses lazy evaluation for all that. - m4 = m4 * (m4 + m4); // here Eigen chooses to first evaluate m4 + m4 into a temporary. - // indeed, here it is an optimization to cache this intermediate result. - m3 = m3 * m4.block<3,3>(1,1); // here Eigen chooses NOT to evaluate block() into a temporary - // because accessing coefficients of that block expression is not more costly than accessing - // coefficients of a plain matrix. - m4 = m4 * m4.transpose(); // same here, lazy evaluation of the transpose. - m4 = m4 * m4.transpose().eval(); // forces immediate evaluation of the transpose - - std::cout << "*** Step 8 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl; -} diff --git a/testbed/nanogui/ext/glfw/docs/CMakeLists.txt b/testbed/nanogui/ext/glfw/docs/CMakeLists.txt deleted file mode 100644 index 45a6162e..00000000 --- a/testbed/nanogui/ext/glfw/docs/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - -add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE} - WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs - COMMENT "Generating HTML documentation" VERBATIM) - diff --git a/testbed/nanogui/ext/glfw/docs/Doxyfile.in b/testbed/nanogui/ext/glfw/docs/Doxyfile.in deleted file mode 100644 index 8410a850..00000000 --- a/testbed/nanogui/ext/glfw/docs/Doxyfile.in +++ /dev/null @@ -1,1863 +0,0 @@ -# Doxyfile 1.8.3.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = "GLFW" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = @GLFW_VERSION_FULL@ - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "A multi-platform library for OpenGL, window and input" - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = @GLFW_BINARY_DIR@/docs - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = NO - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = YES - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. Note that you specify absolute paths here, but also -# relative paths, which will be relative from the directory where doxygen is -# started. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, -# and language is one of the parsers supported by doxygen: IDL, Java, -# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, -# C++. For instance to make doxygen treat .inc files as Fortran files (default -# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note -# that for custom extensions you also need to set FILE_PATTERNS otherwise the -# files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented classes, -# or namespaces to their corresponding documentation. Such a link can be -# prevented in individual cases by by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES (the -# default) will make doxygen replace the get and set methods by a property in -# the documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields will be shown inline in the documentation -# of the scope in which they are defined (i.e. file, namespace, or group -# documentation), provided this scope is documented. If set to NO (the default), -# structs, classes, and unions are shown on a separate page (for HTML and Man -# pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if section-label ... \endif -# and \cond section-label ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. Do not use -# file names with spaces, bibtex cannot handle them. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = @GLFW_BINARY_DIR@/docs/warnings.txt - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = @GLFW_INTERNAL_DOCS@ \ - @GLFW_SOURCE_DIR@/include/GLFW/glfw3.h \ - @GLFW_SOURCE_DIR@/include/GLFW/glfw3native.h \ - @GLFW_SOURCE_DIR@/docs/main.dox \ - @GLFW_SOURCE_DIR@/docs/news.dox \ - @GLFW_SOURCE_DIR@/docs/moving.dox \ - @GLFW_SOURCE_DIR@/docs/quick.dox \ - @GLFW_SOURCE_DIR@/docs/compile.dox \ - @GLFW_SOURCE_DIR@/docs/build.dox \ - @GLFW_SOURCE_DIR@/docs/intro.dox \ - @GLFW_SOURCE_DIR@/docs/context.dox \ - @GLFW_SOURCE_DIR@/docs/monitor.dox \ - @GLFW_SOURCE_DIR@/docs/window.dox \ - @GLFW_SOURCE_DIR@/docs/input.dox \ - @GLFW_SOURCE_DIR@/docs/rift.dox \ - @GLFW_SOURCE_DIR@/docs/compat.dox - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.h *.dox - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = APIENTRY GLFWAPI - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = @GLFW_SOURCE_DIR@/examples - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page (index.html). -# This can be useful if you have a project on for instance GitHub and want reuse -# the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = glfw GLFW_ - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = @GLFW_SOURCE_DIR@/docs/header.html - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = @GLFW_SOURCE_DIR@/docs/footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If left blank doxygen will -# generate a default style sheet. Note that it is recommended to use -# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this -# tag will in the future become obsolete. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional -# user-defined cascading style sheet that is included after the standard -# style sheets created by doxygen. Using this option one can overrule -# certain style aspects. This is preferred over using HTML_STYLESHEET -# since it does not replace the standard style sheet and is therefor more -# robust against future updates. Doxygen will copy the style sheet file to -# the output directory. - -HTML_EXTRA_STYLESHEET = @GLFW_SOURCE_DIR@/docs/extra.css - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = @GLFW_SOURCE_DIR@/docs/spaces.svg - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely -# identify the documentation publisher. This should be a reverse domain-name -# style string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 300 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and -# SVG. The default value is HTML-CSS, which is slower, but has the best -# compatibility. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. -# However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. -# There are two flavours of web server based search depending on the -# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for -# searching and an index file used by the script. When EXTERNAL_SEARCH is -# enabled the indexing and searching needs to be provided by external tools. -# See the manual for details. - -SERVER_BASED_SEARCH = NO - -# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP -# script for searching. Instead the search results are written to an XML file -# which needs to be processed by an external indexer. Doxygen will invoke an -# external search engine pointed to by the SEARCHENGINE_URL option to obtain -# the search results. Doxygen ships with an example indexer (doxyindexer) and -# search engine (doxysearch.cgi) which are based on the open source search engine -# library Xapian. See the manual for configuration details. - -EXTERNAL_SEARCH = NO - -# The SEARCHENGINE_URL should point to a search engine hosted by a web server -# which will returned the search results when EXTERNAL_SEARCH is enabled. -# Doxygen ships with an example search engine (doxysearch) which is based on -# the open source search engine library Xapian. See the manual for configuration -# details. - -SEARCHENGINE_URL = - -# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed -# search data is written to a file for indexing by an external tool. With the -# SEARCHDATA_FILE tag the name of this file can be specified. - -SEARCHDATA_FILE = searchdata.xml - -# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the -# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is -# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple -# projects and redirect the results back to the right project. - -EXTERNAL_SEARCH_ID = - -# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen -# projects other than the one defined by this configuration file, but that are -# all added to the same external search index. Each project needs to have a -# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id -# of to a relative location where the documentation can be found. -# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... - -EXTRA_SEARCH_MAPPINGS = - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = GLFWAPI= \ - GLFW_EXPOSE_NATIVE_WIN32 \ - GLFW_EXPOSE_NATIVE_WGL \ - GLFW_EXPOSE_NATIVE_X11 \ - GLFW_EXPOSE_NATIVE_GLX \ - GLFW_EXPOSE_NATIVE_COCOA \ - GLFW_EXPOSE_NATIVE_NSGL \ - GLFW_EXPOSE_NATIVE_EGL - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths -# or URLs. Note that each tag file must have a unique name (where the name does -# NOT include the path). If a tag file is not located in the directory in which -# doxygen is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# managable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/testbed/nanogui/ext/glfw/docs/DoxygenLayout.xml b/testbed/nanogui/ext/glfw/docs/DoxygenLayout.xml deleted file mode 100644 index 7917f91e..00000000 --- a/testbed/nanogui/ext/glfw/docs/DoxygenLayout.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testbed/nanogui/ext/glfw/docs/build.dox b/testbed/nanogui/ext/glfw/docs/build.dox deleted file mode 100644 index aa6c5fe8..00000000 --- a/testbed/nanogui/ext/glfw/docs/build.dox +++ /dev/null @@ -1,308 +0,0 @@ -/*! - -@page build Building applications - -@tableofcontents - -This is about compiling and linking applications that use GLFW. For information on -how to write such applications, start with the [introductory tutorial](@ref quick). -For information on how to compile the GLFW library itself, see the @ref compile -guide. - -This is not a tutorial on compilation or linking. It assumes basic -understanding of how to compile and link a C program as well as how to use the -specific compiler of your chosen development environment. The compilation -and linking process should be explained in your C programming material and in -the documentation for your development environment. - -@section build_include Including the GLFW header file - -In the source files of your application where you use OpenGL or GLFW, you should -include the GLFW header file, i.e.: - -@code -#include -@endcode - -The GLFW header declares the GLFW API and by default also includes the OpenGL -header of your development environment, which in turn defines all the constants, -types and function prototypes of the OpenGL API. - -The GLFW header also defines everything necessary for your OpenGL header to -function. For example, under Windows you are normally required to include -`windows.h` before the OpenGL header, which would pollute your code namespace -with the entire Win32 API. - -Instead, the GLFW header takes care of this for you, not by including -`windows.h`, but by duplicating only the very few necessary parts of it. It -does this only when needed, so if `windows.h` _is_ included, the GLFW header -does not try to redefine those symbols. The reverse is not true, i.e. -`windows.h` cannot cope if any of its symbols have already been defined. - -In other words: - - - Do _not_ include the OpenGL headers yourself, as GLFW does this for you - - Do _not_ include `windows.h` or other platform-specific headers unless you - plan on using those APIs directly - - If you _do_ need to include such headers, do it _before_ including - the GLFW header and it will handle this - -If you are using an OpenGL extension loading library such as -[glad](https://github.com/Dav1dde/glad), the extension loader header should -either be included _before_ the GLFW one, or the `GLFW_INCLUDE_NONE` macro -(described below) should be defined. - - -@subsection build_macros GLFW header option macros - -These macros may be defined before the inclusion of the GLFW header and affect -its behavior. - -`GLFW_DLL` is required on Windows when using the GLFW DLL, to tell the compiler -that the GLFW functions are defined in a DLL. - -The following macros control which OpenGL or OpenGL ES API header is included. -Only one of these may be defined at a time. - -`GLFW_INCLUDE_GLCOREARB` makes the GLFW header include the modern -`GL/glcorearb.h` header (`OpenGL/gl3.h` on OS X) instead of the regular OpenGL -header. - -`GLFW_INCLUDE_ES1` makes the GLFW header include the OpenGL ES 1.x `GLES/gl.h` -header instead of the regular OpenGL header. - -`GLFW_INCLUDE_ES2` makes the GLFW header include the OpenGL ES 2.0 `GLES2/gl2.h` -header instead of the regular OpenGL header. - -`GLFW_INCLUDE_ES3` makes the GLFW header include the OpenGL ES 3.0 `GLES3/gl3.h` -header instead of the regular OpenGL header. - -`GLFW_INCLUDE_ES31` makes the GLFW header include the OpenGL ES 3.1 `GLES3/gl31.h` -header instead of the regular OpenGL header. - -`GLFW_INCLUDE_NONE` makes the GLFW header not include any OpenGL or OpenGL ES API -header. This is useful in combination with an extension loading library. - -If none of the above inclusion macros are defined, the standard OpenGL `GL/gl.h` -header (`OpenGL/gl.h` on OS X) is included. - -The following macros control the inclusion of additional API headers. Any -number of these may be defined simultaneously, and/or together with one of the -above macros. - -`GLFW_INCLUDE_GLEXT` makes the GLFW header include the appropriate extension -header for the OpenGL or OpenGL ES header selected above after and in addition -to that header. - -`GLFW_INCLUDE_GLU` makes the header include the GLU header in addition to the -header selected above. This should only be used with the standard OpenGL header -and only for legacy code. GLU has been deprecated and should not be used in new -code. - -@note GLFW does not provide any of the API headers mentioned above. They must -be provided by your development environment or your OpenGL or OpenGL ES SDK. - -@note None of these macros may be defined during the compilation of GLFW itself. -If your build includes GLFW and you define any these in your build files, make -sure they are not applied to the GLFW sources. - - -@section build_link Link with the right libraries - -GLFW is essentially a wrapper of various platform-specific APIs and therefore -needs to link against many different system libraries. If you are using GLFW as -a shared library / dynamic library / DLL then it takes care of these links. -However, if you are using GLFW as a static library then your executable will -need to link against these libraries. - -On Windows and OS X, the list of system libraries is static and can be -hard-coded into your build environment. See the section for your development -environment below. On Linux and other Unix-like operating systems, the list -varies but can be retrieved in various ways as described below. - -A good general introduction to linking is -[Beginner's Guide to Linkers](http://www.lurklurk.org/linkers/linkers.html) by -David Drysdale. - - -@subsection build_link_win32 With MinGW or Visual C++ on Windows - -The static version of the GLFW library is named `glfw3`. When using this -version, it is also necessary to link with some libraries that GLFW uses. - -When linking an application under Windows that uses the static version of GLFW, -you must link with `opengl32`. On some versions of MinGW, you must also -explicitly link with `gdi32`, while other versions of MinGW include it in the -set of default libraries along with other dependencies like `user32` and -`kernel32`. If you are using GLU, you must also link with `glu32`. - -The link library for the GLFW DLL is named `glfw3dll`. When compiling an -application that uses the DLL version of GLFW, you need to define the `GLFW_DLL` -macro _before_ any inclusion of the GLFW header. This can be done either with -a compiler switch or by defining it in your source code. - -An application using the GLFW DLL does not need to link against any of its -dependencies, but you still have to link against `opengl32` if your application -uses OpenGL and `glu32` if it uses GLU. - - -@subsection build_link_cmake_source With CMake and GLFW source - -With just a few changes to your `CMakeLists.txt` you can have the GLFW source -tree built along with your application. - -Firstly, add the root directory of the GLFW source tree to your project. This -will add the `glfw` target and the necessary cache variables to your project. - -@code{.cmake} -add_subdirectory(path/to/glfw) -@endcode - -To be able to include the GLFW header from your code, you need to tell the -compiler where to find it. - -@code{.cmake} -include_directories(path/to/glfw/include) -@endcode - -Once GLFW has been added to the project, the `GLFW_LIBRARIES` cache variable -contains all link-time dependencies of GLFW as it is currently configured. To -link against GLFW, link against them and the `glfw` target. - -@code{.cmake} -target_link_libraries(myapp glfw ${GLFW_LIBRARIES}) -@endcode - -Note that `GLFW_LIBRARIES` does not include GLU, as GLFW does not use it. If -your application needs GLU, you can add it to the list of dependencies with the -`OPENGL_glu_LIBRARY` cache variable, which is implicitly created when the GLFW -CMake files look for OpenGL. - -@code{.cmake} -target_link_libraries(myapp glfw ${OPENGL_glu_LIBRARY} ${GLFW_LIBRARIES}) -@endcode - - -@subsection build_link_cmake_pkgconfig With CMake on Unix and installed GLFW binaries - -CMake can import settings from pkg-config, which GLFW supports. When you -installed GLFW, the pkg-config file `glfw3.pc` was installed along with it. - -First you need to find the PkgConfig package. If this fails, you may need to -install the pkg-config package for your distribution. - -@code{.cmake} -find_package(PkgConfig REQUIRED) -@endcode - -This creates the CMake commands to find pkg-config packages. Then you need to -find the GLFW package. - -@code{.cmake} -pkg_search_module(GLFW REQUIRED glfw3) -@endcode - -This creates the CMake variables you need to use GLFW. To be able to include -the GLFW header, you need to tell your compiler where it is. - -@code{.cmake} -include_directories(${GLFW_INCLUDE_DIRS}) -@endcode - -You also need to link against the correct libraries. If you are using the -shared library version of GLFW, use the `GLFW_LIBRARIES` variable. - -@code{.cmake} -target_link_libraries(simple ${GLFW_LIBRARIES}) -@endcode - -If you are using the static library version of GLFW, use the -`GLFW_STATIC_LIBRARIES` variable instead. - -@code{.cmake} -target_link_libraries(simple ${GLFW_STATIC_LIBRARIES}) -@endcode - - -@subsection build_link_pkgconfig With pkg-config on OS X or other Unix - -GLFW supports [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/), -and the `glfw3.pc` pkf-config file is generated when the GLFW library is built -and is installed along with it. A pkg-config file describes all necessary -compile-time and link-time flags and dependencies needed to use a library. When -they are updated or if they differ between systems, you will get the correct -ones automatically. - -A typical compile and link command-line when using the static version of the -GLFW library may look like this: - -@code{.sh} -cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3` -@endcode - -If you are using the shared version of the GLFW library, simply omit the -`--static` flag. - -@code{.sh} -cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3` -@endcode - -You can also use the `glfw3.pc` file without installing it first, by using the -`PKG_CONFIG_PATH` environment variable. - -@code{.sh} -env PKG_CONFIG_PATH=path/to/glfw/src cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3` -@endcode - -The dependencies do not include GLU, as GLFW does not need it. On OS X, GLU is -built into the OpenGL framework, so if you need GLU you don't need to do -anything extra. If you need GLU and are using Linux or BSD, you should add the -`glu` pkg-config module. - -@code{.sh} -cc `pkg-config --cflags glfw3 glu` -o myprog myprog.c `pkg-config --libs glfw3 glu` -@endcode - -If you are using the static version of the GLFW library, make sure you don't link statically against GLU. - -@code{.sh} -cc `pkg-config --cflags glfw3 glu` -o myprog myprog.c `pkg-config --static --libs glfw3` `pkg-config --libs glu` -@endcode - - -@subsection build_link_xcode With Xcode on OS X - -If you are using the dynamic library version of GLFW, simply add it to the -project dependencies. - -If you are using the static library version of GLFW, add it and the Cocoa, -OpenGL, IOKit and CoreVideo frameworks to the project as dependencies. They can -all be found in `/System/Library/Frameworks`. - - -@subsection build_link_osx With command-line on OS X - -It is recommended that you use [pkg-config](@ref build_link_pkgconfig) when -building from the command line on OS X. That way you will get any new -dependencies added automatically. If you still wish to build manually, you need -to add the required frameworks and libraries to your command-line yourself using -the `-l` and `-framework` switches. - -If you are using the dynamic GLFW library, which is named `libglfw.3.dylib`, do: - -@code{.sh} -cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -@endcode - -If you are using the static library, named `libglfw3.a`, substitute `-lglfw3` -for `-lglfw`. - -Note that you do not add the `.framework` extension to a framework when linking -against it from the command-line. - -The OpenGL framework contains both the OpenGL and GLU APIs, so there is nothing -special to do when using GLU. Also note that even though your machine may have -`libGL`-style OpenGL libraries, they are for use with the X Window System and -will _not_ work with the OS X native version of GLFW. - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/compat.dox b/testbed/nanogui/ext/glfw/docs/compat.dox deleted file mode 100644 index 7ff4ab04..00000000 --- a/testbed/nanogui/ext/glfw/docs/compat.dox +++ /dev/null @@ -1,179 +0,0 @@ -/*! - -@page compat Standards conformance - -@tableofcontents - -This guide describes the various API extensions used by this version of GLFW. -It lists what are essentially implementation details, but which are nonetheless -vital knowledge for developers intending to deploy their applications on a wide -range of machines. - -The information in this guide is not a part of GLFW API, but merely -preconditions for some parts of the library to function on a given machine. Any -part of this information may change in future versions of GLFW and that will not -be considered a breaking API change. - - -@section compat_x11 X11 extensions, protocols and IPC standards - -As GLFW uses Xlib directly, without any intervening toolkit -library, it has sole responsibility for interacting well with the many and -varied window managers in use on Unix-like systems. In order for applications -and window managers to work well together, a number of standards and -conventions have been developed that regulate behavior outside the scope of the -X11 API; most importantly the -[Inter-Client Communication Conventions Manual](http://www.tronche.com/gui/x/icccm/) -(ICCCM) and -[Extended Window Manager Hints](http://standards.freedesktop.org/wm-spec/wm-spec-latest.html) -(EWMH) standards. - -GLFW uses the `_MOTIF_WM_HINTS` window property to support borderless windows. -If the running window manager does not support this property, the -`GLFW_DECORATED` hint will have no effect. - -GLFW uses the ICCCM `WM_DELETE_WINDOW` protocol to intercept the user -attempting to close the GLFW window. If the running window manager does not -support this protocol, the close callback will never be called. - -GLFW uses the EWMH `_NET_WM_PING` protocol, allowing the window manager notify -the user when the application has stopped responding, i.e. when it has ceased to -process events. If the running window manager does not support this protocol, -the user will not be notified if the application locks up. - -GLFW uses the EWMH `_NET_WM_STATE_FULLSCREEN` window state to tell the window -manager to make the GLFW window full screen. If the running window manager does -not support this state, full screen windows may not work properly. GLFW has -a fallback code path in case this state is unavailable, but every window manager -behaves slightly differently in this regard. - -GLFW uses the EWMH `_NET_WM_BYPASS_COMPOSITOR` window property to tell a -compositing window manager to un-redirect full screen GLFW windows. If the -running window manager uses compositing but does not support this property then -additional copying may be performed for each buffer swap of full screen windows. - -GLFW uses the -[clipboard manager protocol](http://www.freedesktop.org/wiki/ClipboardManager/) -to push a clipboard string (i.e. selection) owned by a GLFW window about to be -destroyed to the clipboard manager. If there is no running clipboard manager, -the clipboard string will be unavailable once the window has been destroyed. - -GLFW uses the -[X drag-and-drop protocol](http://www.freedesktop.org/wiki/Specifications/XDND/) -to provide file drop events. If the application originating the drag does not -support this protocol, drag and drop will not work. - -GLFW uses the XInput 2 extension to provide sub-pixel cursor motion events. If -the running X server does not support this version of this extension, cursor -motion will be snapped to the pixel grid. - -GLFW uses the XRandR 1.3 extension to provide multi-monitor support. If the -running X server does not support this version of this extension, multi-monitor -support will not function and only a single, desktop-spanning monitor will be -reported. - -GLFW uses the XRandR 1.3 and Xf86vidmode extensions to provide gamma ramp -support. If the running X server does not support either or both of these -extensions, gamma ramp support will not function. - -GLFW uses the Xkb extension and detectable auto-repeat to provide keyboard -input. If the running X server does not support this extension, a non-Xkb -fallback path is used. - - -@section compat_glx GLX extensions - -The GLX API is the default API used to create OpenGL contexts on Unix-like -systems using the X Window System. - -GLFW uses the GLX 1.3 `GLXFBConfig` functions to enumerate and select framebuffer pixel -formats. If GLX 1.3 is not supported, @ref glfwInit will fail. - -GLFW uses the `GLX_MESA_swap_control,` `GLX_EXT_swap_control` and -`GLX_SGI_swap_control` extensions to provide vertical retrace synchronization -(or _vsync_), in that order of preference. Where none of these extension are -available, calling @ref glfwSwapInterval will have no effect. - -GLFW uses the `GLX_ARB_multisample` extension to create contexts with -multisampling anti-aliasing. Where this extension is unavailable, the -`GLFW_SAMPLES` hint will have no effect. - -GLFW uses the `GLX_ARB_create_context` extension when available, even when -creating OpenGL contexts of version 2.1 and below. Where this extension is -unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` -hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint -will have no effect, and setting the `GLFW_OPENGL_PROFILE` or -`GLFW_OPENGL_FORWARD_COMPAT` hints to `GL_TRUE` will cause @ref -glfwCreateWindow to fail. - -GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for -context profiles. Where this extension is unavailable, setting the -`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE`, or setting -`GLFW_CLIENT_API` to anything but `GLFW_OPENGL_API` will cause @ref -glfwCreateWindow to fail. - -GLFW uses the `GLX_ARB_context_flush_control` extension to provide control over -whether a context is flushed when it is released (made non-current). Where this -extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no -effect and the context will always be flushed when released. - -@section compat_wgl WGL extensions - -The WGL API is used to create OpenGL contexts on Microsoft Windows and other -implementations of the Win32 API, such as Wine. - -GLFW uses either the `WGL_EXT_extension_string` or the -`WGL_ARB_extension_string` extension to check for the presence of all other WGL -extensions listed below. If both are available, the EXT one is preferred. If -neither is available, no other extensions are used and many GLFW features -related to context creation will have no effect or cause errors when used. - -GLFW uses the `WGL_EXT_swap_control` extension to provide vertical retrace -synchronization (or _vsync_). Where this extension is unavailable, calling @ref -glfwSwapInterval will have no effect. - -GLFW uses the `WGL_ARB_pixel_format` and `WGL_ARB_multisample` extensions to -create contexts with multisampling anti-aliasing. Where these extensions are -unavailable, the `GLFW_SAMPLES` hint will have no effect. - -GLFW uses the `WGL_ARB_create_context` extension when available, even when -creating OpenGL contexts of version 2.1 and below. Where this extension is -unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` -hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint -will have no effect, and setting the `GLFW_OPENGL_PROFILE` or -`GLFW_OPENGL_FORWARD_COMPAT` hints to `GL_TRUE` will cause @ref -glfwCreateWindow to fail. - -GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for -context profiles. Where this extension is unavailable, setting the -`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE` will cause -@ref glfwCreateWindow to fail. - -GLFW uses the `WGL_ARB_context_flush_control` extension to provide control over -whether a context is flushed when it is released (made non-current). Where this -extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no -effect and the context will always be flushed when released. - -@section compat_osx OpenGL 3.2 and later on OS X - -Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then -only forward-compatible, core profile contexts are supported. Support for -OpenGL 4.1 was introduced with OS X 10.9, also limited to forward-compatible, -core profile contexts. There is also still no mechanism for requesting debug -contexts. Versions of Mac OS X earlier than 10.7 support at most OpenGL -version 2.1. - -Because of this, on OS X 10.7 and later, the `GLFW_CONTEXT_VERSION_MAJOR` and -`GLFW_CONTEXT_VERSION_MINOR` hints will cause @ref glfwCreateWindow to fail if -given version 3.0 or 3.1, the `GLFW_OPENGL_FORWARD_COMPAT` hint must be set to -`GL_TRUE` and the `GLFW_OPENGL_PROFILE` hint must be set to -`GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts and the -`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored. - -Also, on Mac OS X 10.6 and below, the `GLFW_CONTEXT_VERSION_MAJOR` and -`GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1, -setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to -a non-default value will cause @ref glfwCreateWindow to fail and the -`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored. - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/compile.dox b/testbed/nanogui/ext/glfw/docs/compile.dox deleted file mode 100644 index 11d3798c..00000000 --- a/testbed/nanogui/ext/glfw/docs/compile.dox +++ /dev/null @@ -1,324 +0,0 @@ -/*! - -@page compile Compiling GLFW - -@tableofcontents - -This is about compiling the GLFW library itself. For information on how to -build applications that use GLFW, see the @ref build guide. - - -@section compile_cmake Using CMake - -GLFW uses [CMake](http://www.cmake.org/) to generate project files or makefiles -for a particular development environment. If you are on a Unix-like system such -as Linux or FreeBSD or have a package system like Fink, MacPorts, Cygwin or -Homebrew, you can simply install its CMake package. If not, you can download -installers for Windows and OS X from the [CMake website](http://www.cmake.org/). - -@note CMake only generates project files or makefiles. It does not compile the -actual GLFW library. To compile GLFW, first generate these files and then use -them in your chosen development environment to compile the actual GLFW library. - - -@subsection compile_deps Dependencies - -Once you have installed CMake, make sure that all other dependencies are -available. On some platforms, GLFW needs a few additional packages to be -installed. See the section for your chosen platform and development environment -below. - - -@subsubsection compile_deps_msvc Dependencies for Visual C++ on Windows - -The Microsoft Platform SDK that is installed along with Visual C++ already -contains all the necessary headers, link libraries and tools except for CMake. -Move on to @ref compile_generate. - - -@subsubsection compile_deps_mingw Dependencies for MinGW or MinGW-w64 on Windows - -Both the MinGW and the MinGW-w64 packages already contain all the necessary -headers, link libraries and tools except for CMake. Move on to @ref -compile_generate. - - -@subsubsection compile_deps_mingw_cross Dependencies for MinGW or MinGW-w64 cross-compilation - -Both Cygwin and many Linux distributions have MinGW or MinGW-w64 packages. For -example, Cygwin has the `mingw64-i686-gcc` and `mingw64-x86_64-gcc` packages -for 32- and 64-bit version of MinGW-w64, while Debian GNU/Linux and derivatives -like Ubuntu have the `mingw-w64` package for both. - -GLFW has CMake toolchain files in the `CMake/` directory that allow for easy -cross-compilation of Windows binaries. To use these files you need to add a -special parameter when generating the project files or makefiles: - -@code{.sh} -cmake -DCMAKE_TOOLCHAIN_FILE= . -@endcode - -The exact toolchain file to use depends on the prefix used by the MinGW or -MinGW-w64 binaries on your system. You can usually see this in the /usr -directory. For example, both the Debian/Ubuntu and Cygwin MinGW-w64 packages -have `/usr/x86_64-w64-mingw32` for the 64-bit compilers, so the correct -invocation would be: - -@code{.sh} -cmake -DCMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake . -@endcode - -For more details see the article -[CMake Cross Compiling](http://www.paraview.org/Wiki/CMake_Cross_Compiling) on -the CMake wiki. - -Once you have this set up, move on to @ref compile_generate. - - -@subsubsection compile_deps_xcode Dependencies for Xcode on OS X - -Xcode comes with all necessary tools except for CMake. The required headers -and libraries are included in the core OS X frameworks. Xcode can be downloaded -from the Mac App Store or from the ADC Member Center. - -Once you have Xcode installed, move on to @ref compile_generate. - - -@subsubsection compile_deps_x11 Dependencies for Linux and X11 - -To compile GLFW for X11, you need to have the X11 and OpenGL header packages -installed, as well as the basic development tools like GCC and make. For -example, on Ubuntu and other distributions based on Debian GNU/Linux, you need -to install the `xorg-dev` and `libglu1-mesa-dev` packages. The former pulls in -all X.org header packages and the latter pulls in the Mesa OpenGL and GLU -packages. GLFW itself doesn't need or use GLU, but some of the examples do. -Note that using header files and libraries from Mesa during compilation -_will not_ tie your binaries to the Mesa implementation of OpenGL. - -Once you have installed the necessary packages, move on to @ref -compile_generate. - - -@subsection compile_generate Generating build files with CMake - -Once you have all necessary dependencies it is time to generate the project -files or makefiles for your development environment. CMake needs to know two -paths for this: the path to the _root_ directory of the GLFW source tree (i.e. -_not_ the `src` subdirectory) and the target path for the generated files and -compiled binaries. If these are the same, it is called an in-tree build, -otherwise it is called an out-of-tree build. - -One of several advantages of out-of-tree builds is that you can generate files -and compile for different development environments using a single source tree. - -@note This section is about generating the project files or makefiles necessary -to compile the GLFW library, not about compiling the actual library. - - -@subsubsection compile_generate_cli Generating files with the CMake command-line tool - -To make an in-tree build, enter the _root_ directory of the GLFW source tree -(i.e. _not_ the `src` subdirectory) and run CMake. The current directory is -used as target path, while the path provided as an argument is used to find the -source tree. - -@code{.sh} -cd -cmake . -@endcode - -To make an out-of-tree build, make another directory, enter it and run CMake -with the (relative or absolute) path to the root of the source tree as an -argument. - -@code{.sh} -cd -mkdir build -cd build -cmake .. -@endcode - -Once you have generated the project files or makefiles for your chosen -development environment, move on to @ref compile_compile. - - -@subsubsection compile_generate_gui Generating files with the CMake GUI - -If you are using the GUI version, choose the root of the GLFW source tree as -source location and the same directory or another, empty directory as the -destination for binaries. Choose _Configure_, change any options you wish to, -_Configure_ again to let the changes take effect and then _Generate_. - -Once you have generated the project files or makefiles for your chosen -development environment, move on to @ref compile_compile. - - -@subsection compile_compile Compiling the library - -You should now have all required dependencies and the project files or makefiles -necessary to compile GLFW. Go ahead and compile the actual GLFW library with -these files, as you would with any other project. - -Once the GLFW library is compiled, you are ready to build your applications, -linking it to the GLFW library. See the @ref build guide for more information. - - -@subsection compile_options CMake options - -The CMake files for GLFW provide a number of options, although not all are -available on all supported platforms. Some of these are de facto standards -among projects using CMake and so have no `GLFW_` prefix. - -If you are using the GUI version of CMake, these are listed and can be changed -from there. If you are using the command-line version, use the `ccmake` tool. -Some package systems like Ubuntu and other distributions based on Debian -GNU/Linux have this tool in a separate `cmake-curses-gui` package. - - -@subsubsection compile_options_shared Shared CMake options - -`BUILD_SHARED_LIBS` determines whether GLFW is built as a static -library or as a DLL / shared library / dynamic library. - -`LIB_SUFFIX` affects where the GLFW shared /dynamic library is installed. If it -is empty, it is installed to `${CMAKE_INSTALL_PREFIX}/lib`. If it is set to -`64`, it is installed to `${CMAKE_INSTALL_PREFIX}/lib64`. - -`GLFW_CLIENT_LIBRARY` determines which client API library to use. If set to -`opengl` the OpenGL library is used, if set to `glesv1` for the OpenGL ES 1.x -library is used, or if set to `glesv2` the OpenGL ES 2.0 library is used. The -selected library and its header files must be present on the system for this to -work. - -`GLFW_BUILD_EXAMPLES` determines whether the GLFW examples are built -along with the library. - -`GLFW_BUILD_TESTS` determines whether the GLFW test programs are -built along with the library. - -`GLFW_BUILD_DOCS` determines whether the GLFW documentation is built along with -the library. - - -@subsubsection compile_options_osx OS X specific CMake options - -`GLFW_USE_CHDIR` determines whether `glfwInit` changes the current -directory of bundled applications to the `Contents/Resources` directory. - -`GLFW_USE_MENUBAR` determines whether the first call to -`glfwCreateWindow` sets up a minimal menu bar. - -`GLFW_USE_RETINA` determines whether windows will use the full resolution of -Retina displays. - -`GLFW_BUILD_UNIVERSAL` determines whether to build Universal Binaries. - - -@subsubsection compile_options_win32 Windows specific CMake options - -`USE_MSVC_RUNTIME_LIBRARY_DLL` determines whether to use the DLL version or the -static library version of the Visual C++ runtime library. If set to `ON`, the -DLL version of the Visual C++ library is used. It is recommended to set this to -`ON`, as this keeps the executable smaller and benefits from security and bug -fix updates of the Visual C++ runtime. - -`GLFW_USE_DWM_SWAP_INTERVAL` determines whether the swap interval is set even -when DWM compositing is enabled. If this is `ON`, the swap interval is set even -if DWM is enabled. It is recommended to set this to `OFF`, as doing otherwise -can lead to severe jitter. - -`GLFW_USE_OPTIMUS_HPG` determines whether to export the `NvOptimusEnablement` -symbol, which forces the use of the high-performance GPU on Nvidia Optimus -systems. This symbol needs to be exported by the EXE to be detected by the -driver, so the override will not work if GLFW is built as a DLL. See _Enabling -High Performance Graphics Rendering on Optimus Systems_ for more details. - - -@subsubsection compile_options_egl EGL specific CMake options - -`GLFW_USE_EGL` determines whether to use EGL instead of the platform-specific -context creation API. Note that EGL is not yet provided on all supported -platforms. - - -@section compile_manual Compiling GLFW manually - -If you wish to compile GLFW without its CMake build environment then you will -have to do at least some of the platform detection yourself. GLFW needs -a number of configuration macros to be defined in order to know what it's being -compiled for and has many optional, platform-specific ones for various features. - -When building with CMake, the `glfw_config.h` configuration header is generated -based on the current platform and CMake options. The GLFW CMake environment -defines `_GLFW_USE_CONFIG_H`, which causes this header to be included by -`internal.h`. Without this macro, GLFW will expect the necessary configuration -macros to be defined on the command-line. - -Three macros _must_ be defined when compiling GLFW: one selecting the window -creation API, one selecting the context creation API and one client library. -Exactly one of each kind must be defined for GLFW to compile and link. - -The window creation API is used to create windows, handle input, monitors, gamma -ramps and clipboard. The options are: - - - `_GLFW_COCOA` to use the Cocoa frameworks - - `_GLFW_WIN32` to use the Win32 API - - `_GLFW_X11` to use the X Window System - - `_GLFW_WAYLAND` to use the Wayland API (experimental and incomplete) - - `_GLFW_MIR` to use the Mir API (experimental and incomplete) - -The context creation API is used to enumerate pixel formats / framebuffer -configurations and to create contexts. The options are: - - - `_GLFW_NSGL` to use the Cocoa OpenGL framework - - `_GLFW_WGL` to use the Win32 WGL API - - `_GLFW_GLX` to use the X11 GLX API - - `_GLFW_EGL` to use the EGL API - -Wayland and Mir both require the EGL backend. - -The client library is the one providing the OpenGL or OpenGL ES API, which is -used by GLFW to probe the created context. This is not the same thing as the -client API, as many desktop OpenGL client libraries now expose the OpenGL ES API -through extensions. The options are: - - - `_GLFW_USE_OPENGL` for the desktop OpenGL (opengl32.dll, libGL.so or - OpenGL.framework) - - `_GLFW_USE_GLESV1` for OpenGL ES 1.x (experimental) - - `_GLFW_USE_GLESV2` for OpenGL ES 2.x (experimental) - -Note that `_GLFW_USE_GLESV1` and `_GLFW_USE_GLESV2` may only be used with EGL, -as the other context creation APIs do not interface with OpenGL ES client -libraries. - -If you are building GLFW as a shared library / dynamic library / DLL then you -must also define `_GLFW_BUILD_DLL`. Otherwise, you may not define it. - -If you are using the X11 window creation API then you _must_ also select an entry -point retrieval mechanism. - - - `_GLFW_HAS_GLXGETPROCADDRESS` to use `glXGetProcAddress` (recommended) - - `_GLFW_HAS_GLXGETPROCADDRESSARB` to use `glXGetProcAddressARB` (legacy) - - `_GLFW_HAS_GLXGETPROCADDRESSEXT` to use `glXGetProcAddressEXT` (legacy) - - `_GLFW_HAS_DLOPEN` to do manual retrieval with `dlopen` (fallback) - -In addition, support for the following X11 extensions can be enabled: - - - `_GLFW_HAS_XINPUT` to use XInput2 for high-resolution cursor motion - (recommended) - -If you are using the Cocoa window creation API, the following options are -available: - - - `_GLFW_USE_CHDIR` to `chdir` to the `Resources` subdirectory of the - application bundle during @ref glfwInit (recommended) - - `_GLFW_USE_MENUBAR` to create and populate the menu bar when the first window - is created (recommended) - - `_GLFW_USE_RETINA` to have windows use the full resolution of Retina displays - (recommended) - -@note None of the @ref build_macros may be defined during the compilation of -GLFW. If you define any of these in your build files, make sure they are not -applied to the GLFW sources. - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/context.dox b/testbed/nanogui/ext/glfw/docs/context.dox deleted file mode 100644 index eaa754b8..00000000 --- a/testbed/nanogui/ext/glfw/docs/context.dox +++ /dev/null @@ -1,329 +0,0 @@ -/*! - -@page context Context guide - -@tableofcontents - -This guide introduces the OpenGL and OpenGL ES context related functions of -GLFW. There are also guides for the other areas of the GLFW API. - - - @ref intro - - @ref window - - @ref monitor - - @ref input - - -@section context_object Context objects - -A window object encapsulates both a top-level window and an OpenGL or OpenGL ES -context. It is created with @ref glfwCreateWindow and destroyed with @ref -glfwDestroyWindow or @ref glfwTerminate. See @ref window_creation for more -information. - -As the window and context are inseparably linked, the window object also serves -as the context handle. - -To test the creation of various kinds of contexts and see their properties, run -the `glfwinfo` test program. - - -@subsection context_hints Context creation hints - -There are a number of hints, specified using @ref glfwWindowHint, related to -what kind of context is created. See -[context related hints](@ref window_hints_ctx) in the window guide. - - -@subsection context_sharing Context object sharing - -When creating a window and its OpenGL or OpenGL ES context with @ref -glfwCreateWindow, you can specify another window whose context the new one -should share its objects (textures, vertex and element buffers, etc.) with. - -@code -GLFWwindow* second_window = glfwCreateWindow(640, 480, "Second Window", NULL, first_window); -@endcode - -Object sharing is implemented by the operating system and graphics driver. On -platforms where it is possible to choose which types of objects are shared, GLFW -requests that all types are shared. - -See the relevant chapter of the [OpenGL](https://www.opengl.org/registry/) or -[OpenGL ES](http://www.khronos.org/opengles/) reference documents for more -information. The name and number of this chapter unfortunately varies between -versions and APIs, but has at times been named _Shared Objects and Multiple -Contexts_. - -GLFW comes with a simple object sharing test program called `sharing`. - - -@subsection context_offscreen Offscreen contexts - -GLFW doesn't support creating contexts without an associated window. However, -contexts with hidden windows can be created with the -[GLFW_VISIBLE](@ref window_hints_wnd) window hint. - -@code -glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - -GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL); -@endcode - -The window never needs to be shown and its context can be used as a plain -offscreen context. Depending on the window manager, the size of a hidden -window's framebuffer may not be usable or modifiable, so framebuffer -objects are recommended for rendering with such contexts. - -__OS X:__ The first time a window is created the menu bar is populated with -common commands like Hide, Quit and About. This is not desirable for example -when writing a command-line only application. The menu bar setup can be -disabled with a [compile-time option](@ref compile_options_osx). - - -@section context_current Current context - -Before you can make OpenGL or OpenGL ES calls, you need to have a current -context of the correct type. A context can only be current for a single thread -at a time, and a thread can only have a single context current at a time. - -The context of a window is made current with @ref glfwMakeContextCurrent. - -@code -glfwMakeContextCurrent(window); -@endcode - -The window of the current context is returned by @ref glfwGetCurrentContext. - -@code -GLFWwindow* window = glfwGetCurrentContext(); -@endcode - -The following GLFW functions require a context to be current. Calling any these -functions without a current context will generate a @ref GLFW_NO_CURRENT_CONTEXT -error. - - - @ref glfwSwapInterval - - @ref glfwExtensionSupported - - @ref glfwGetProcAddress - - -@section context_swap Buffer swapping - -Buffer swapping is part of the window and framebuffer, not the context. See -@ref buffer_swap. - - -@section context_glext OpenGL and OpenGL ES extensions - -One of the benefits of OpenGL and OpenGL ES are their extensibility. -Hardware vendors may include extensions in their implementations that extend the -API before that functionality is included in a new version of the OpenGL or -OpenGL ES specification, and some extensions are never included and remain -as extensions until they become obsolete. - -An extension is defined by: - -- An extension name (e.g. `GL_ARB_debug_output`) -- New OpenGL tokens (e.g. `GL_DEBUG_SEVERITY_HIGH_ARB`) -- New OpenGL functions (e.g. `glGetDebugMessageLogARB`) - -Note the `ARB` affix, which stands for Architecture Review Board and is used -for official extensions. The extension above was created by the ARB, but there -are many different affixes, like `NV` for Nvidia and `AMD` for, well, AMD. Any -group may also use the generic `EXT` affix. Lists of extensions, together with -their specifications, can be found at the -[OpenGL Registry](http://www.opengl.org/registry/) and -[OpenGL ES Registry](https://www.khronos.org/registry/gles/). - - -@subsection context_glext_auto Loading extension with a loader library - -An extension loader library is the easiest and best way to access both OpenGL and -OpenGL ES extensions and modern versions of the core OpenGL or OpenGL ES APIs. -They will take care of all the details of declaring and loading everything you -need. One such library is [glad](https://github.com/Dav1dde/glad) and there are -several others. - -The following example will use glad but all extension loader libraries work -similarly. - -First you need to generate the source files using the glad Python script. This -example generates a loader for any version of OpenGL, which is the default for -both GLFW and glad, but loaders for OpenGL ES, as well as loaders for specific -API versions and extension sets can be generated. The generated files are -written to the `output` directory. - -@code{.sh} -python main.py --generator c --no-loader --out-path output -@endcode - -The `--no-loader` option is added because GLFW already provides a function for -loading OpenGL and OpenGL ES function pointers and glad can call this instead of -having to implement its own. There are several other command-line options as -well. See the glad documentation for details. - -Add the generated `output/src/glad.c`, `output/include/glad/glad.h` and -`output/include/KHR/khrplatform.h` files to your build. Then you need to -include the glad header file, which will replace the OpenGL header of your -development environment. By including the glad header before the GLFW header, -it suppresses the development environment's OpenGL or OpenGL ES header. - -@code -#include -#include -@endcode - -Finally you need to initialize glad once you have a suitable current context. - -@code -window = glfwCreateWindow(640, 480, "My Window", NULL, NULL); -if (!window) -{ - ... -} - -glfwMakeContextCurrent(window); - -gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); -@endcode - -Once glad has been loaded, you have access to all OpenGL core and extension -functions supported by both the context you created and the glad loader you -generated and you are ready to start rendering. - -You can specify a minimum required OpenGL or OpenGL ES version with -[context hints](@ref window_hints_ctx). If your needs are more complex, you can -check the actual OpenGL or OpenGL ES version with -[context attributes](@ref window_attribs_ctx), or you can check whether -a specific version is supported by the current context with the -`GLAD_GL_VERSION_x_x` booleans. - -@code -if (GLAD_GL_VERSION_3_2) -{ - // Call OpenGL 3.2+ specific code -} -@endcode - -To check whether a specific extension is supported, use the `GLAD_GL_xxx` -booleans. - -@code -if (GLAD_GL_ARB_debug_output) -{ - // Use GL_ARB_debug_output -} -@endcode - - -@subsection context_glext_manual Loading extensions manually - -__Do not use this technique__ unless it is absolutely necessary. An -[extension loader library](@ref context_glext_auto) will save you a ton of -tedious, repetitive, error prone work. - -To use a certain extension, you must first check whether the context supports -that extension and then, if it introduces new functions, retrieve the pointers -to those functions. GLFW provides @ref glfwExtensionSupported and @ref -glfwGetProcAddress for manual loading of extensions and new API functions. - -This section will demonstrate manual loading of OpenGL extensions. The loading -of OpenGL ES extensions is identical except for the name of the extension header. - - -@subsubsection context_glext_header The glext.h header - -The `glext.h` extension header is a continually updated file that defines the -interfaces for all OpenGL extensions. The latest version of this can always be -found at the [OpenGL Registry](http://www.opengl.org/registry/). There are also -extension headers for the various versions of OpenGL ES at the -[OpenGL ES Registry](https://www.khronos.org/registry/gles/). It it strongly -recommended that you use your own copy of the extension header, as the one -included in your development environment may be several years out of date and -may not include the extensions you wish to use. - -The header defines function pointer types for all functions of all extensions it -supports. These have names like `PFNGLGETDEBUGMESSAGELOGARBPROC` (for -`glGetDebugMessageLogARB`), i.e. the name is made uppercase and `PFN` (pointer -to function) and `PROC` (procedure) are added to the ends. - -To include the extension header, define [GLFW_INCLUDE_GLEXT](@ref build_macros) -before including the GLFW header. - -@code -#define GLFW_INCLUDE_GLEXT -#include -@endcode - - -@subsubsection context_glext_string Checking for extensions - -A given machine may not actually support the extension (it may have older -drivers or a graphics card that lacks the necessary hardware features), so it -is necessary to check at run-time whether the context supports the extension. -This is done with @ref glfwExtensionSupported. - -@code -if (glfwExtensionSupported("GL_ARB_debug_output")) -{ - // The extension is supported by the current context -} -@endcode - -The argument is a null terminated ASCII string with the extension name. If the -extension is supported, @ref glfwExtensionSupported returns `GL_TRUE`, otherwise -it returns `GL_FALSE`. - - -@subsubsection context_glext_proc Fetching function pointers - -Many extensions, though not all, require the use of new OpenGL functions. -These functions often do not have entry points in the client API libraries of -your operating system, making it necessary to fetch them at run time. You can -retrieve pointers to these functions with @ref glfwGetProcAddress. - -@code -PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog = glfwGetProcAddress("glGetDebugMessageLogARB"); -@endcode - -In general, you should avoid giving the function pointer variables the (exact) -same name as the function, as this may confuse your linker. Instead, you can -use a different prefix, like above, or some other naming scheme. - -Now that all the pieces have been introduced, here is what they might look like -when used together. - -@code -#define GLFW_INCLUDE_GLEXT -#include - -#define glGetDebugMessageLogARB pfnGetDebugMessageLog -PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog; - -// Flag indicating whether the extension is supported -int has_ARB_debug_output = 0; - -void load_extensions(void) -{ - if (glfwExtensionSupported("GL_ARB_debug_output")) - { - pfnGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGARBPROC) glfwGetProcAddress("glGetDebugMessageLogARB"); - if (pfnGetDebugMessageLog) - { - // Both the extension name and the function pointer are present - has_ARB_debug_output = 1; - } - } -} - -void some_function(void) -{ - if (has_ARB_debug_output) - { - // Now the extension function can be called as usual - glGetDebugMessageLogARB(...); - } -} -@endcode - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/extra.css b/testbed/nanogui/ext/glfw/docs/extra.css deleted file mode 100644 index e9896fae..00000000 --- a/testbed/nanogui/ext/glfw/docs/extra.css +++ /dev/null @@ -1 +0,0 @@ -#navrow1,#navrow2,#navrow3,#navrow4,.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code{background:none}#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,hr,.memSeparator{border:none}.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.reflist dt a.el,.levels span,.directory .levels span{text-shadow:none}.memdoc,dl.reflist dd{box-shadow:none}div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code{padding:0}#nav-path,.directory .levels,span.lineno{display:none}html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code{background:#f2f2f2}body{color:#4d4d4d}h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em{color:#1a1a1a;border-bottom:none}h1{padding-top:0.5em;font-size:180%}h2{padding-top:0.5em;margin-bottom:0;font-size:140%}h3{padding-top:0.5em;margin-bottom:0;font-size:110%}.glfwheader{font-size:16px;height:64px;max-width:920px;min-width:800px;padding:0 32px;margin:0 auto}#glfwhome{line-height:64px;padding-right:48px;color:#666;font-size:2.5em;background:url("http://www.glfw.org/css/arrow.png") no-repeat right}.glfwnavbar{list-style-type:none;margin:0 auto;float:right}#glfwhome,.glfwnavbar li{float:left}.glfwnavbar a,.glfwnavbar a:visited{line-height:64px;margin-left:2em;display:block;color:#666}#glfwhome,.glfwnavbar a,.glfwnavbar a:visited{transition:.35s ease}#titlearea,.footer{color:#666}address.footer{text-align:center;padding:2em;margin-top:3em}#top{background:#666}#navrow1,#navrow2,#navrow3,#navrow4{max-width:920px;min-width:800px;margin:0 auto;font-size:13px}.tablist{height:36px;display:block;position:relative}.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a{color:#f2f2f2}.tablist li.current a{background:linear-gradient(to bottom, #ffa733 0, #f60 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;color:#fff}.contents{min-height:590px}div.contents,div.header{max-width:920px;margin:0 auto;padding:0 32px;background:#fff none}table.doxtable th,dl.reflist dt{background:linear-gradient(to bottom, #ffa733 0, #f60 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;color:#fff}dl.reflist dt a.el{color:#f60;padding:.2em;border-radius:4px;background-color:#ffe0cc}div.toc{float:none;width:auto}div.toc h3{font-size:1.17em}div.toc ul{padding-left:1.5em}div.toc li{font-size:1em;padding-left:0;list-style-type:disc}div.toc,.memproto,div.qindex,div.ah{background:linear-gradient(to bottom, #f2f2f2 0, #e6e6e6 100%);box-shadow:inset 0 0 32px #e6e6e6;text-shadow:0 1px 1px #fff;color:#1a1a1a;border:2px solid #e6e6e6;border-radius:4px}.paramname{color:#803300}dl.reflist dt{border:2px solid #f60;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:none}dl.reflist dd{border:2px solid #f60;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none}table.doxtable{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,.tablist a:hover,span.lineno a:hover{color:#f60;text-decoration:none}div.directory{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}hr,.memSeparator{height:2px;background:linear-gradient(to right, #f2f2f2 0, #d9d9d9 50%, #f2f2f2 100%)}dl.note,dl.pre,dl.post,dl.invariant{background:linear-gradient(to bottom, #ddfad1 0, #cbf7ba 100%);box-shadow:inset 0 0 32px #baf5a3;color:#1e5309;border:2px solid #afe599}dl.warning,dl.attention{background:linear-gradient(to bottom, #fae8d1 0, #f7ddba 100%);box-shadow:inset 0 0 32px #f5d1a3;color:#533309;border:2px solid #e5c499}dl.deprecated,dl.bug{background:linear-gradient(to bottom, #fad1e3 0, #f7bad6 100%);box-shadow:inset 0 0 32px #f5a3c8;color:#53092a;border:2px solid #e599bb}dl.todo,dl.test{background:linear-gradient(to bottom, #d1ecfa 0, #bae3f7 100%);box-shadow:inset 0 0 32px #a3daf5;color:#093a53;border:2px solid #99cce5}dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test{border-radius:4px;padding:1em;text-shadow:0 1px 1px #fff;margin:1em 0}.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited{color:inherit}div.line{line-height:inherit}div.fragment,pre.fragment{background:#f2f2f2;border-radius:4px;border:none;padding:1em;overflow:auto;border-left:4px solid #ccc;margin:1em 0}.lineno a,.lineno a:visited,.line,pre.fragment{color:#4d4d4d}span.preprocessor,span.comment{color:#007899}a.code,a.code:visited{color:#e64500}span.keyword,span.keywordtype,span.keywordflow{color:#404040;font-weight:bold}span.stringliteral{color:#360099}code{padding:.1em;border-radius:4px} diff --git a/testbed/nanogui/ext/glfw/docs/extra.less b/testbed/nanogui/ext/glfw/docs/extra.less deleted file mode 100644 index 9d0ce975..00000000 --- a/testbed/nanogui/ext/glfw/docs/extra.less +++ /dev/null @@ -1,370 +0,0 @@ -// NOTE: Please use this file to perform modifications on default style sheets. -// -// You need to install a few Ruby gems to generate extra.css from this file: -// gem install less therubyracer -// -// Run this command to regenerate extra.css after you're finished with changes: -// lessc --compress extra.less > extra.css -// -// Alternatively you can use online services to regenerate extra.css. - - -// Default text color for page contents -@default-text-color: hsl(0,0%,30%); - -// Page header, footer, table rows, inline codes and definition lists -@header-footer-background-color: hsl(0,0%,95%); - -// Page header, footer links and navigation bar background -@header-footer-link-color: hsl(0,0%,40%); - -// Doxygen navigation bar links -@navbar-link-color: @header-footer-background-color; - -// Page content background color -@content-background-color: hsl(0,0%,100%); - -// Bold, italic, h1, h2, ... and table of contents -@heading-color: hsl(0,0%,10%); - -// Function, enum and macro definition separator -@def-separator-color: @header-footer-background-color; - -// Base color hue -@base-hue: 24; - -// Default color used for links -@default-link-color: hsl(@base-hue,100%,50%); - -// Doxygen navigation bar active tab -@tab-text-color: hsl(0,0%,100%); -@tab-background-color1: @default-link-color; -@tab-background-color2: lighten(spin(@tab-background-color1, 10), 10%); - -// Table borders -@default-border-color: @default-link-color; - -// Table header -@table-text-color: @tab-text-color; -@table-background-color1: @tab-background-color1; -@table-background-color2: @tab-background-color2; - -// Table of contents, data structure index and prototypes -@toc-background-color1: hsl(0,0%,90%); -@toc-background-color2: lighten(@toc-background-color1, 5%); - -// Function prototype parameters color -@prototype-param-color: darken(@default-link-color, 25%); - -// Message box color: note, pre, post and invariant -@box-note-color: hsl(103,80%,85%); - -// Message box color: warning and attention -@box-warning-color: hsl(34,80%,85%); - -// Message box color: deprecated and bug -@box-bug-color: hsl(333,80%,85%); - -// Message box color: todo and test -@box-todo-color: hsl(200,80%,85%); - -// Message box helper function -.message-box(@base-color) { - background:linear-gradient(to bottom,lighten(@base-color, 5%) 0%,@base-color 100%); - box-shadow:inset 0 0 32px darken(@base-color, 5%); - color:darken(@base-color, 67%); - border:2px solid desaturate(darken(@base-color, 10%), 20%); -} - - -#navrow1,#navrow2,#navrow3,#navrow4,.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code { - background:none; -} - -#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,hr,.memSeparator { - border:none; -} - -.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.reflist dt a.el,.levels span,.directory .levels span { - text-shadow:none; -} - -.memdoc,dl.reflist dd { - box-shadow:none; -} - -div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code { - padding:0; -} - -#nav-path,.directory .levels,span.lineno { - display:none; -} - -html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code { - background:@header-footer-background-color; -} - -body { - color:@default-text-color; -} - -h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em { - color:@heading-color; - border-bottom:none; -} - -h1 { - padding-top:0.5em; - font-size:180%; -} - -h2 { - padding-top:0.5em; - margin-bottom:0; - font-size:140%; -} - -h3 { - padding-top:0.5em; - margin-bottom:0; - font-size:110%; -} - -.glfwheader { - font-size:16px; - height:64px; - max-width:920px; - min-width:800px; - padding:0 32px; - margin:0 auto; -} - -#glfwhome { - line-height:64px; - padding-right:48px; - color:@header-footer-link-color; - font-size:2.5em; - background:url("http://www.glfw.org/css/arrow.png") no-repeat right; -} - -.glfwnavbar { - list-style-type:none; - margin:0 auto; - float:right; -} - -#glfwhome,.glfwnavbar li { - float:left; -} - -.glfwnavbar a,.glfwnavbar a:visited { - line-height:64px; - margin-left:2em; - display:block; - color:@header-footer-link-color; -} - -#glfwhome,.glfwnavbar a,.glfwnavbar a:visited { - transition:.35s ease; -} - -#titlearea,.footer { - color:@header-footer-link-color; -} - -address.footer { - text-align:center; - padding:2em; - margin-top:3em; -} - -#top { - background:@header-footer-link-color; -} - -#navrow1,#navrow2,#navrow3,#navrow4 { - max-width:920px; - min-width:800px; - margin:0 auto; - font-size:13px; -} - -.tablist { - height:36px; - display:block; - position:relative; -} - -.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a { - color:@navbar-link-color; -} - -.tablist li.current a { - background:linear-gradient(to bottom,@tab-background-color2 0%,@tab-background-color1 100%); - box-shadow:inset 0 0 32px @tab-background-color1; - text-shadow:0 -1px 1px darken(@tab-background-color1, 15%); - color:@tab-text-color; -} - -.contents { - min-height:590px; -} - -div.contents,div.header { - max-width:920px; - margin:0 auto; - padding:0 32px; - background:@content-background-color none; -} - -table.doxtable th,dl.reflist dt { - background:linear-gradient(to bottom,@table-background-color2 0%,@table-background-color1 100%); - box-shadow:inset 0 0 32px @table-background-color1; - text-shadow:0 -1px 1px darken(@table-background-color1, 15%); - color:@table-text-color; -} - -dl.reflist dt a.el { - color:@default-link-color; - padding:.2em; - border-radius:4px; - background-color:lighten(@default-link-color, 40%); -} - -div.toc { - float:none; - width:auto; -} - -div.toc h3 { - font-size:1.17em; -} - -div.toc ul { - padding-left:1.5em; -} - -div.toc li { - font-size:1em; - padding-left:0; - list-style-type:disc; -} - -div.toc,.memproto,div.qindex,div.ah { - background:linear-gradient(to bottom,@toc-background-color2 0%,@toc-background-color1 100%); - box-shadow:inset 0 0 32px @toc-background-color1; - text-shadow:0 1px 1px lighten(@toc-background-color2, 10%); - color:@heading-color; - border:2px solid @toc-background-color1; - border-radius:4px; -} - -.paramname { - color:@prototype-param-color; -} - -dl.reflist dt { - border:2px solid @default-border-color; - border-top-left-radius:4px; - border-top-right-radius:4px; - border-bottom:none; -} - -dl.reflist dd { - border:2px solid @default-border-color; - border-bottom-right-radius:4px; - border-bottom-left-radius:4px; - border-top:none; -} - -table.doxtable { - border-collapse:inherit; - border-spacing:0; - border:2px solid @default-border-color; - border-radius:4px; -} - -a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,.tablist a:hover,span.lineno a:hover { - color:@default-link-color; - text-decoration:none; -} - -div.directory { - border-collapse:inherit; - border-spacing:0; - border:2px solid @default-border-color; - border-radius:4px; -} - -hr,.memSeparator { - height:2px; - background:linear-gradient(to right,@def-separator-color 0%,darken(@def-separator-color, 10%) 50%,@def-separator-color 100%); -} - -dl.note,dl.pre,dl.post,dl.invariant { - .message-box(@box-note-color); -} - -dl.warning,dl.attention { - .message-box(@box-warning-color); -} - -dl.deprecated,dl.bug { - .message-box(@box-bug-color); -} - -dl.todo,dl.test { - .message-box(@box-todo-color); -} - -dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test { - border-radius:4px; - padding:1em; - text-shadow:0 1px 1px hsl(0,0%,100%); - margin:1em 0; -} - -.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited { - color:inherit; -} - -div.line { - line-height:inherit; -} - -div.fragment,pre.fragment { - background:hsl(0,0%,95%); - border-radius:4px; - border:none; - padding:1em; - overflow:auto; - border-left:4px solid hsl(0,0%,80%); - margin:1em 0; -} - -.lineno a,.lineno a:visited,.line,pre.fragment { - color:@default-text-color; -} - -span.preprocessor,span.comment { - color:hsl(193,100%,30%); -} - -a.code,a.code:visited { - color:hsl(18,100%,45%); -} - -span.keyword,span.keywordtype,span.keywordflow { - color:darken(@default-text-color, 5%); - font-weight:bold; -} - -span.stringliteral { - color:hsl(261,100%,30%); -} - -code { - padding:.1em; - border-radius:4px; -} diff --git a/testbed/nanogui/ext/glfw/docs/footer.html b/testbed/nanogui/ext/glfw/docs/footer.html deleted file mode 100644 index b0434ca1..00000000 --- a/testbed/nanogui/ext/glfw/docs/footer.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/testbed/nanogui/ext/glfw/docs/header.html b/testbed/nanogui/ext/glfw/docs/header.html deleted file mode 100644 index 9759d8b0..00000000 --- a/testbed/nanogui/ext/glfw/docs/header.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - -$projectname: $title -$title - - - -$treeview -$search -$mathjax - -$extrastylesheet - - -
    - - - - - diff --git a/testbed/nanogui/ext/glfw/docs/input.dox b/testbed/nanogui/ext/glfw/docs/input.dox deleted file mode 100644 index fb38808b..00000000 --- a/testbed/nanogui/ext/glfw/docs/input.dox +++ /dev/null @@ -1,588 +0,0 @@ -/*! - -@page input Input guide - -@tableofcontents - -This guide introduces the input related functions of GLFW. There are also -guides for the other areas of GLFW. - - - @ref intro - - @ref window - - @ref context - - @ref monitor - -GLFW provides many kinds of input. While some can only be polled, like time, or -only received via callbacks, like scrolling, there are those that provide both -callbacks and polling. Where a callback is provided, that is the recommended -way to receive that kind of input. The more you can use callbacks the less time -your users' machines will need to spend polling. - -All input callbacks receive a window handle. By using the -[window user pointer](@ref window_userptr), you can access non-global structures -or objects from your callbacks. - -To get a better feel for how the various events callbacks behave, run the -`events` test program. It register every callback supported by GLFW and prints -out all arguments provided for every event, along with time and sequence -information. - - -@section events Event processing - -GLFW needs to communicate regularly with the window system both in order to -receive events and to show that the application hasn't locked up. Event -processing must be done regularly while you have visible windows and is normally -done each frame after [buffer swapping](@ref buffer_swap). - -There are two functions for processing pending events. @ref glfwPollEvents, -processes only those events that have already been received and then returns -immediately. - -@code -glfwPollEvents(); -@endcode - -This is the best choice when rendering continually, like most games do. - -If you only need to update the contents of the window when you receive new -input, @ref glfwWaitEvents is a better choice. - -@code -glfwWaitEvents(); -@endcode - -It puts the thread to sleep until at least one event has been received and then -processes all received events. This saves a great deal of CPU cycles and is -useful for, for example, editing tools. There must be at least one GLFW window -for this function to sleep. - -If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from -another thread by posting an empty event to the event queue with @ref -glfwPostEmptyEvent. - -@code -glfwPostEmptyEvent(); -@endcode - -Do not assume that callbacks will _only_ be called through either of the above -functions. While it is necessary to process events in the event queue, some -window systems will send some events directly to the application, which in turn -causes callbacks to be called outside of regular event processing. - - -@section input_keyboard Keyboard input - -GLFW divides keyboard input into two categories; key events and character -events. Key events relate to actual physical keyboard keys, whereas character -events relate to the Unicode code points generated by pressing some of them. - -Keys and characters do not map 1:1. A single key press may produce several -characters, and a single character may require several keys to produce. This -may not be the case on your machine, but your users are likely not all using the -same keyboard layout, input method or even operating system as you. - - -@subsection input_key Key input - -If you wish to be notified when a physical key is pressed or released or when it -repeats, set a key callback. - -@code -glfwSetKeyCallback(window, key_callback); -@endcode - -The callback function receives the [keyboard key](@ref keys), platform-specific -scancode, key action and [modifier bits](@ref mods). - -@code -void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_E && action == GLFW_PRESS) - activate_airship(); -} -@endcode - -The action is one of `GLFW_PRESS`, `GLFW_REPEAT` or `GLFW_RELEASE`. The key -will be `GLFW_KEY_UNKNOWN` if GLFW lacks a key token for it. These keys still -have unique, if platform-specific scancodes. - -The scancode is unique for every key but is platform-specific, so a scancode -will map to different keys on different platforms. - -The key will be `GLFW_KEY_UNKNOWN` for special keys like _E-mail_ or _Play_ that -don't have a key token. Those keys will still have unique, if platform-specific -scancodes. - -Key states for [named keys](@ref keys) are also saved in per-window state arrays -that can be polled with @ref glfwGetKey. - -@code -int state = glfwGetKey(window, GLFW_KEY_E); -if (state == GLFW_PRESS) - activate_airship(); -@endcode - -The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -This function only returns cached key event state. It does not poll the -system for the current state of the key. - -Whenever you poll state, you risk missing the state change you are looking for. -If a pressed key is released again before you poll its state, you will have -missed the key press. The recommended solution for this is to use a -key callback, but there is also the `GLFW_STICKY_KEYS` input mode. - -@code -glfwSetInputMode(window, GLFW_STICKY_KEYS, 1); -@endcode - -When sticky keys mode is enabled, the pollable state of a key will remain -`GLFW_PRESS` until the state of that key is polled with @ref glfwGetKey. Once -it has been polled, if a key release event had been processed in the meantime, -the state will reset to `GLFW_RELEASE`, otherwise it will remain `GLFW_PRESS`. - -The `GLFW_KEY_LAST` constant holds the highest value of any -[named key](@ref keys). - - -@subsection input_char Text input - -GLFW supports text input in the form of a stream of -[Unicode code points](https://en.wikipedia.org/wiki/Unicode), as produced by the -operating system text input system. Unlike key input, text input obeys keyboard -layouts and modifier keys and supports composing characters using -[dead keys](https://en.wikipedia.org/wiki/Dead_key). Once received, you can -encode the code points into -[UTF-8](https://en.wikipedia.org/wiki/UTF-8) or any other encoding you prefer. - -Because an `unsigned int` is 32 bits long on all platforms supported by GLFW, -you can treat the code point argument as native endian -[UTF-32](https://en.wikipedia.org/wiki/UTF-32). - -There are two callbacks for receiving Unicode code points. If you wish to -offer regular text input, set a character callback. - -@code -glfwSetCharCallback(window, character_callback); -@endcode - -The callback function receives Unicode code points for key events that would -have led to regular text input and generally behaves as a standard text field on -that platform. - -@code -void character_callback(GLFWwindow* window, unsigned int codepoint) -{ -} -@endcode - -If you wish to receive even those Unicode code points generated with modifier -key combinations that a plain text field would ignore, or just want to know -exactly what modifier keys were used, set a character with modifiers callback. - -@code -glfwSetCharModsCallback(window, charmods_callback); -@endcode - -The callback function receives Unicode code points and -[modifier bits](@ref mods). - -@code -void charmods_callback(GLFWwindow* window, unsigned int codepoint, int mods) -{ -} -@endcode - - -@section input_mouse Mouse input - -Mouse input comes in many forms, including cursor motion, button presses and -scrolling offsets. The cursor appearance can also be changed, either to -a custom image or a standard cursor shape from the system theme. - - -@subsection cursor_pos Cursor position - -If you wish to be notified when the cursor moves over the window, set a cursor -position callback. - -@code -glfwSetCursorPosCallback(window, cursor_pos_callback); -@endcode - -The callback functions receives the cursor position. On platforms that provide -it, the full sub-pixel cursor position is passed on. - -@code -static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos) -{ -} -@endcode - -The cursor position is also saved per-window and can be polled with @ref -glfwGetCursorPos. - -@code -double xpos, ypos; -glfwGetCursorPos(window, &xpos, &ypos); -@endcode - - -@subsection cursor_mode Cursor modes - -The `GLFW_CURSOR` input mode provides several cursor modes for special forms of -mouse motion input. By default, the cursor mode is `GLFW_CURSOR_NORMAL`, -meaning the regular arrow cursor (or another cursor set with @ref glfwSetCursor) -is used and cursor motion is not limited. - -If you wish to implement mouse motion based camera controls or other input -schemes that require unlimited mouse movement, set the cursor mode to -`GLFW_CURSOR_DISABLED`. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); -@endcode - -This will hide the cursor and lock it to the specified window. GLFW will then -take care of all the details of cursor re-centering and offset calculation and -providing the application with a virtual cursor position. This virtual position -is provided normally via both the cursor position callback and through polling. - -@note You should not implement your own version of this functionality using -other features of GLFW. It is not supported and will not work as robustly as -`GLFW_CURSOR_DISABLED`. - -If you just wish the cursor to become hidden when it is over a window, set -the cursor mode to `GLFW_CURSOR_HIDDEN`. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); -@endcode - -This mode puts no limit on the motion of the cursor. - -To exit out of either of these special modes, restore the `GLFW_CURSOR_NORMAL` -cursor mode. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); -@endcode - - -@subsection cursor_object Cursor objects - -GLFW supports creating both custom and system theme cursor images, encapsulated -as @ref GLFWcursor objects. They are created with @ref glfwCreateCursor or @ref -glfwCreateStandardCursor and destroyed with @ref glfwDestroyCursor, or @ref -glfwTerminate, if any remain. - - -@subsubsection cursor_custom Custom cursor creation - -A custom cursor is created with @ref glfwCreateCursor, which returns a handle to -the created cursor object. For example, this creates a 16x16 white square -cursor with the hot-spot in the upper-left corner: - -@code -unsigned char pixels[16 * 16 * 4]; -memset(pixels, 0xff, sizeof(pixels)); - -GLFWimage image; -image.width = 16; -image.height = 16; -image.pixels = pixels; - -GLFWcursor* cursor = glfwCreateCursor(&image, 0, 0); -@endcode - -If cursor creation fails, `NULL` will be returned, so it is necessary to check -the return value. - -The image data is 32-bit RGBA, i.e. eight bits per channel. The pixels are -arranged canonically as sequential rows, starting from the top-left corner. - - -@subsubsection cursor_standard Standard cursor creation - -A cursor with a [standard shape](@ref shapes) from the current system cursor -theme can be can be created with @ref glfwCreateStandardCursor. - -@code -GLFWcursor* cursor = glfwCreateStandardCursor(GLFW_HRESIZE_CURSOR); -@endcode - -These cursor objects behave in the exact same way as those created with @ref -glfwCreateCursor except that the system cursor theme provides the actual image. - - -@subsubsection cursor_destruction Cursor destruction - -When a cursor is no longer needed, destroy it with @ref glfwDestroyCursor. - -@code -glfwDestroyCursor(cursor); -@endcode - -Cursor destruction always succeeds. All cursors remaining when @ref -glfwTerminate is called are destroyed as well. - - -@subsubsection cursor_set Cursor setting - -A cursor can be set as current for a window with @ref glfwSetCursor. - -@code -glfwSetCursor(window, cursor); -@endcode - -Once set, the cursor image will be used as long as the system cursor is over the -client area of the window and the [cursor mode](@ref cursor_mode) is set -to `GLFW_CURSOR_NORMAL`. - -A single cursor may be set for any number of windows. - -To remove a cursor from a window, set the cursor of that window to `NULL`. - -@code -glfwSetCursor(window, NULL); -@endcode - -When a cursor is destroyed, it is removed from any window where it is set. This -does not affect the cursor modes of those windows. - - -@subsection cursor_enter Cursor enter/leave events - -If you wish to be notified when the cursor enters or leaves the client area of -a window, set a cursor enter/leave callback. - -@code -glfwSetCursorEnterCallback(window, cursor_enter_callback); -@endcode - -The callback function receives the new classification of the cursor. - -@code -void cursor_enter_callback(GLFWwindow* window, int entered) -{ - if (entered) - { - // The cursor entered the client area of the window - } - else - { - // The cursor left the client area of the window - } -} -@endcode - - -@subsection input_mouse_button Mouse button input - -If you wish to be notified when a mouse button is pressed or released, set -a mouse button callback. - -@code -glfwSetMouseButtonCallback(window, mouse_button_callback); -@endcode - -The callback function receives the [mouse button](@ref buttons), button action -and [modifier bits](@ref mods). - -@code -void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS) - popup_menu(); -} -@endcode - -The action is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -Mouse button states for [named buttons](@ref buttons) are also saved in -per-window state arrays that can be polled with @ref glfwGetMouseButton. - -@code -int state = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT); -if (state == GLFW_PRESS) - upgrade_cow(); -@endcode - -The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -This function only returns cached mouse button event state. It does not poll -the system for the current state of the mouse button. - -Whenever you poll state, you risk missing the state change you are looking for. -If a pressed mouse button is released again before you poll its state, you will have -missed the button press. The recommended solution for this is to use a -mouse button callback, but there is also the `GLFW_STICKY_MOUSE_BUTTONS` -input mode. - -@code -glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, 1); -@endcode - -When sticky mouse buttons mode is enabled, the pollable state of a mouse button -will remain `GLFW_PRESS` until the state of that button is polled with @ref -glfwGetMouseButton. Once it has been polled, if a mouse button release event -had been processed in the meantime, the state will reset to `GLFW_RELEASE`, -otherwise it will remain `GLFW_PRESS`. - -The `GLFW_MOUSE_BUTTON_LAST` constant holds the highest value of any -[named button](@ref buttons). - - -@subsection scrolling Scroll input - -If you wish to be notified when the user scrolls, whether with a mouse wheel or -touchpad gesture, set a scroll callback. - -@code -glfwSetScrollCallback(window, scroll_callback); -@endcode - -The callback function receives two-dimensional scroll offsets. - -@code -void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) -{ -} -@endcode - -A simple mouse wheel, being vertical, provides offsets along the Y-axis. - - -@section joystick Joystick input - -The joystick functions expose connected joysticks and controllers, with both -referred to as joysticks. It supports up to sixteen joysticks, ranging from -`GLFW_JOYSTICK_1`, `GLFW_JOYSTICK_2` up to `GLFW_JOYSTICK_LAST`. You can test -whether a [joystick](@ref joysticks) is present with @ref glfwJoystickPresent. - -@code -int present = glfwJoystickPresent(GLFW_JOYSTICK_1); -@endcode - -When GLFW is initialized, detected joysticks are added to to the beginning of -the array, starting with `GLFW_JOYSTICK_1`. Once a joystick is detected, it -keeps its assigned index until it is disconnected, so as joysticks are connected -and disconnected, they will become spread out. - -Joystick state is updated as needed when a joystick function is called and does -not require a window to be created or @ref glfwPollEvents or @ref glfwWaitEvents -to be called. - - -@subsection joystick_axis Joystick axis states - -The positions of all axes of a joystick are returned by @ref -glfwGetJoystickAxes. See the reference documentation for the lifetime of the -returned array. - -@code -int count; -const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1, &count); -@endcode - -Each element in the returned array is a value between -1.0 and 1.0. - - -@subsection joystick_button Joystick button states - -The states of all buttons of a joystick are returned by @ref -glfwGetJoystickButtons. See the reference documentation for the lifetime of the -returned array. - -@code -int count; -const unsigned char* axes = glfwGetJoystickButtons(GLFW_JOYSTICK_1, &count); -@endcode - -Each element in the returned array is either `GLFW_PRESS` or `GLFW_RELEASE`. - - -@subsection joystick_name Joystick name - -The human-readable, UTF-8 encoded name of a joystick is returned by @ref -glfwGetJoystickName. See the reference documentation for the lifetime of the -returned string. - -@code -const char* name = glfwGetJoystickName(GLFW_JOYSTICK_1); -@endcode - -Joystick names are not guaranteed to be unique. Two joysticks of the same model -and make may have the same name. Only the [joystick token](@ref joysticks) is -guaranteed to be unique, and only until that joystick is disconnected. - - -@section time Time input - -GLFW provides high-resolution time input, in seconds, with @ref glfwGetTime. - -@code -double seconds = glfwGetTime(); -@endcode - -It returns the number of seconds since the timer was started when the library -was initialized with @ref glfwInit. The platform-specific time sources used -usually have micro- or nanosecond resolution. - -You can modify the reference time with @ref glfwSetTime. - -@code -glfwSetTime(4.0); -@endcode - -This sets the timer to the specified time, in seconds. - - -@section clipboard Clipboard input and output - -If the system clipboard contains a UTF-8 encoded string or if it can be -converted to one, you can retrieve it with @ref glfwGetClipboardString. See the -reference documentation for the lifetime of the returned string. - -@code -const char* clipboard = glfwGetClipboardString(window); -@endcode - -The contents of the system clipboard can be set to a UTF-8 encoded string with -@ref glfwSetClipboardString. - -@code -glfwSetClipboardString(window, "A string with words in it"); -@endcode - -The clipboard functions take a window handle argument because some window -systems require a window to communicate with the system clipboard. Any valid -window may be used. - - -@section path_drop Path drop input - -If you wish to receive the paths of files and/or directories dropped on -a window, set a file drop callback. - -@code -glfwSetDropCallback(window, drop_callback); -@endcode - -The callback function receives an array of paths encoded as UTF-8. - -@code -void drop_callback(GLFWwindow* window, int count, const char** paths) -{ - int i; - for (i = 0; i < count; i++) - handle_dropped_file(paths[i]); -} -@endcode - -The path array and its strings are only valid until the file drop callback -returns, as they may have been generated specifically for that event. You need -to make a deep copy of the array if you want to keep the paths. - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/internal.dox b/testbed/nanogui/ext/glfw/docs/internal.dox deleted file mode 100644 index 0389af6e..00000000 --- a/testbed/nanogui/ext/glfw/docs/internal.dox +++ /dev/null @@ -1,116 +0,0 @@ -/*! - -@page internals Internal structure - -@tableofcontents - -There are several interfaces inside GLFW. Each interface has its own area of -responsibility and its own naming conventions. - - -@section internals_public Public interface - -The most well-known is the public interface, described in the glfw3.h header -file. This is implemented in source files shared by all platforms and these -files contain no platform-specific code. This code usually ends up calling the -platform and internal interfaces to do the actual work. - -The public interface uses the OpenGL naming conventions except with GLFW and -glfw instead of GL and gl. For struct members, where OpenGL sets no precedent, -it use headless camel case. - -Examples: @ref glfwCreateWindow, @ref GLFWwindow, @ref GLFWvidmode.redBits, -`GLFW_RED_BITS` - - -@section internals_native Native interface - -The [native interface](@ref native) is a small set of publicly available -but platform-specific functions, described in the glfw3native.h header file and -used to gain access to the underlying window, context and (on some platforms) -display handles used by the platform interface. - -The function names of the native interface are similar to those of the public -interface, but embeds the name of the interface that the returned handle is -from. - -Examples: @ref glfwGetX11Window, @ref glfwGetWGLContext - - -@section internals_internal Internal interface - -The internal interface consists of utility functions used by all other -interfaces. It is shared code implemented in the same shared source files as -the public and event interfaces. The internal interface is described in the -internal.h header file. - -The internal interface is in charge of GLFW's global data, which it stores in -a `_GLFWlibrary` struct named `_glfw`. - -The internal interface uses the same style as the public interface, except all -global names have a leading underscore. - -Examples: @ref _glfwIsValidContextConfig, @ref _GLFWwindow, `_glfw.currentRamp` - - -@section internals_platform Platform interface - -The platform interface implements all platform-specific operations as a service -to the public interface. This includes event processing. The platform -interface is never directly called by application code and never directly calls -application-provided callbacks. It is also prohibited from modifying the -platform-independent part of the internal structs. Instead, it calls the event -interface when events interesting to GLFW are received. - -The platform interface mirrors those parts of the public interface that needs to -perform platform-specific operations on some or all platforms. The are also -named the same except that the glfw function prefix is replaced by -_glfwPlatform. - -Examples: @ref _glfwPlatformCreateWindow - -The platform interface also defines structs that contain platform-specific -global and per-object state. Their names mirror those of the internal -interface, except that an interface-specific suffix is added. - -Examples: `_GLFWwindowX11`, `_GLFWcontextWGL` - -These structs are incorporated as members into the internal interface structs -using special macros that name them after the specific interface used. This -prevents shared code from accidentally using these members. - -Examples: `window.win32.handle`, `_glfw.x11.display` - - -@section internals_event Event interface - -The event interface is implemented in the same shared source files as the public -interface and is responsible for delivering the events it receives to the -application, either via callbacks, via window state changes or both. - -The function names of the event interface use a `_glfwInput` prefix and the -ObjectEvent pattern. - -Examples: @ref _glfwInputWindowFocus, @ref _glfwInputCursorMotion - - -@section internals_static Static functions - -Static functions may be used by any interface and have no prefixes or suffixes. -These use headless camel case. - -Examples: `clearScrollOffsets` - - -@section internals_config Configuration macros - -GLFW uses a number of configuration macros to select at compile time which -interfaces and code paths to use. They are defined in the glfw_config.h header file, -which is generated from the `glfw_config.h.in` file by CMake. - -Configuration macros the same style as tokens in the public interface, except -with a leading underscore. - -Examples: `_GLFW_HAS_GLXGETPROCADDRESS` - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/intro.dox b/testbed/nanogui/ext/glfw/docs/intro.dox deleted file mode 100644 index 07e0e767..00000000 --- a/testbed/nanogui/ext/glfw/docs/intro.dox +++ /dev/null @@ -1,351 +0,0 @@ -/*! - -@page intro Introduction to the API - -@tableofcontents - -This guide introduces the basic concepts of GLFW and describes initialization, -error handling and API guarantees and limitations. For a broad but shallow -tutorial, see @ref quick instead. There are also guides for the other areas of -GLFW. - - - @ref window - - @ref context - - @ref monitor - - @ref input - - -@section intro_init Initialization and termination - -Before most GLFW functions may be called, the library must be initialized. -This initialization checks what features are available on the machine, -enumerates monitors and joysticks, initializes the timer and performs any -required platform-specific initialization. - -Only the following functions may be called before the library has been -successfully initialized, and only from the main thread. - - - @ref glfwGetVersion - - @ref glfwGetVersionString - - @ref glfwSetErrorCallback - - @ref glfwInit - - @ref glfwTerminate - -Calling any other function before that time will cause a @ref -GLFW_NOT_INITIALIZED error. - - -@subsection intro_init_init Initializing GLFW - -The library is initialized with @ref glfwInit, which returns `GL_FALSE` if an -error occurred. - -@code -if (!glfwInit()) -{ - // Handle initialization failure -} -@endcode - -If any part of initialization fails, all remaining bits are terminated as if -@ref glfwTerminate was called. The library only needs to be initialized once -and additional calls to an already initialized library will simply return -`GL_TRUE` immediately. - -Once the library has been successfully initialized, it should be terminated -before the application exits. - - -@subsection intro_init_terminate Terminating GLFW - -Before your application exits, you should terminate the GLFW library if it has -been initialized. This is done with @ref glfwTerminate. - -@code -glfwTerminate(); -@endcode - -This will destroy any remaining window, monitor and cursor objects, restore any -modified gamma ramps, re-enable the screensaver if it had been disabled and free -any resources allocated by GLFW. - -Once the library is terminated, it is as if it had never been initialized and -you will need to initialize it again before being able to use GLFW. If the -library was not initialized or had already been terminated, it return -immediately. - - -@section error_handling Error handling - -Some GLFW functions have return values that indicate an error, but this is often -not very helpful when trying to figure out _why_ the error occurred. Some -functions also return otherwise valid values on error. Finally, far from all -GLFW functions have return values. - -This is where the error callback comes in. This callback is called whenever an -error occurs. It is set with @ref glfwSetErrorCallback, a function that may be -called regardless of whether GLFW is initialized. - -@code -glfwSetErrorCallback(error_callback); -@endcode - -The error callback receives a human-readable description of the error and (when -possible) its cause. The description encoded as UTF-8. The callback is also -provided with an [error code](@ref errors). - -@code -void error_callback(int error, const char* description) -{ - puts(description); -} -@endcode - -The error code indicates the general category of the error. Some error codes, -such as @ref GLFW_NOT_INITIALIZED has only a single meaning, whereas others like -@ref GLFW_PLATFORM_ERROR are used for many different errors. - -The description string is only valid until the error callback returns, as it may -have been generated specifically for that error. This lets GLFW provide much -more specific error descriptions but means you must make a copy if you want to -keep the description string. - -@note Relying on erroneous behavior is not forward compatible. In other words, -do not rely on a currently invalid call to generate a specific error, as that -same call may in future versions generate a different error or become valid. - - -@section coordinate_systems Coordinate systems - -GLFW has two primary coordinate systems: the _virtual screen_ and the window -_client area_ or _content area_. Both use the same unit: _virtual screen -coordinates_, or just _screen coordinates_, which don't necessarily correspond -to pixels. - - - -Both the virtual screen and the client area coordinate systems have the X-axis -pointing to the right and the Y-axis pointing down. - -Window and monitor positions are specified as the position of the upper-left -corners of their content areas relative to the virtual screen, while cursor -positions are specified relative to a window's client area. - -Because the origin of the window's client area coordinate system is also the -point from which the window position is specified, you can translate client area -coordinates to the virtual screen by adding the window position. The window -frame, when present, extends out from the client area but does not affect the -window position. - -Almost all positions and sizes in GLFW are measured in screen coordinates -relative to one of the two origins above. This includes cursor positions, -window positions and sizes, window frame sizes, monitor positions and video mode -resolutions. - -Two exceptions are the [monitor physical size](@ref monitor_size), which is -measured in millimetres, and [framebuffer size](@ref window_fbsize), which is -measured in pixels. - -Pixels and screen coordinates may map 1:1 on your machine, but they won't on -every other machine, for example on a Mac with a Retina display. The ratio -between screen coordinates and pixels may also change at run-time depending on -which monitor the window is currently considered to be on. - - -@section guarantees_limitations Guarantees and limitations - -This section describes the conditions under which GLFW can be expected to -function, barring bugs in the operating system or drivers. Use of GLFW outside -of these limits may work on some platforms, or on some machines, or some of the -time, or on some versions of GLFW, but it may break at any time and this will -not be considered a bug. - - -@subsection lifetime Pointer lifetimes - -GLFW will never free any pointer you provide to it and you must never free any -pointer it provides to you. - -Many GLFW functions return pointers to dynamically allocated structures, strings -or arrays, and some callbacks are provided with strings or arrays. These are -always managed by GLFW and should never be freed by the application. The -lifetime of these pointers is documented for each GLFW function and callback. -If you need to keep this data, you must copy it before its lifetime expires. - -Many GLFW functions accept pointers to structures or strings allocated by the -application. These are never freed by GLFW and are always the responsibility of -the application. If GLFW needs to keep the data in these structures or strings, -it is copied before the function returns. - -Pointer lifetimes are guaranteed not to be shortened in future minor or patch -releases. - - -@subsection reentrancy Reentrancy - -GLFW event processing and object creation and destruction are not reentrant. -This means that the following functions may not be called from any callback -function: - - - @ref glfwCreateWindow - - @ref glfwDestroyWindow - - @ref glfwCreateCursor - - @ref glfwCreateStandardCursor - - @ref glfwDestroyCursor - - @ref glfwPollEvents - - @ref glfwWaitEvents - - @ref glfwTerminate - -These functions may be made reentrant in future minor or patch releases, but -functions not on this list will not be made non-reentrant. - - -@subsection thread_safety Thread safety - -Most GLFW functions may only be called from the main thread, but some may be -called from any thread. However, no GLFW function may be called from any other -thread until GLFW has been successfully initialized on the main thread, -including functions that may called before initialization. - -The reference documentation for every GLFW function states whether it is limited -to the main thread. - -The following categories of functions are and will remain limited to the main -thread due to the limitations of one or several platforms: - - - Initialization and termination - - Event processing - - Creation and destruction of window, context and cursor objects - -Because event processing must be performed on the main thread, all callbacks -except for the error callback will only be called on that thread. The error -callback may be called on any thread, as any GLFW function may generate errors. - -The posting of empty events may be done from any thread. The window user -pointer and close flag may also be accessed and modified from any thread, but -this is not synchronized by GLFW. The following window related functions may -be called from any thread: - - - @ref glfwPostEmptyEvent - - @ref glfwGetWindowUserPointer - - @ref glfwSetWindowUserPointer - - @ref glfwWindowShouldClose - - @ref glfwSetWindowShouldClose - -Rendering may be done on any thread. The following context related functions -may be called from any thread: - - - @ref glfwMakeContextCurrent - - @ref glfwGetCurrentContext - - @ref glfwSwapBuffers - - @ref glfwSwapInterval - - @ref glfwExtensionSupported - - @ref glfwGetProcAddress - -The timer may be accessed from any thread, but this is not synchronized by GLFW. -The following timer related functions may be called from any thread: - - - @ref glfwGetTime - -Library version information may be queried from any thread. The following -version related functions may be called from any thread: - - - @ref glfwGetVersion - - @ref glfwGetVersionString - -GLFW uses no synchronization objects internally except for thread-local storage -to keep track of the current context for each thread. Synchronization is left -to the application. - -Functions that may currently be called from any thread will always remain so, -but functions that are currently limited to the main may be updated to allow -calls from any thread in future releases. - - -@subsection compatibility Version compatibility - -GLFW guarantees binary backward compatibility with earlier minor versions of the -API. This means that you can drop in a newer version of the GLFW DLL / shared -library / dynamic library and existing applications will continue to run. - -Once a function or constant has been added, the signature of that function or -value of that constant will remain unchanged until the next major version of -GLFW. No compatibility of any kind is guaranteed between major versions. - -Undocumented behavior, i.e. behavior that is not described in the documentation, -may change at any time until it is documented. - -If the reference documentation and the implementation differ, the reference -documentation is correct and the implementation will be fixed in the next -release. - - -@subsection event_order Event order - -The order of arrival of related events is not guaranteed to be consistent -across platforms. The exception is synthetic key and mouse button release -events, which are always delivered after the window defocus event. - - -@section intro_version Version management - -GLFW provides mechanisms for identifying what version of GLFW your application -was compiled against as well as what version it is currently running against. -If you are loading GLFW dynamically (not just linking dynamically), you can use -this to verify that the library binary is compatible with your application. - - -@subsection intro_version_compile Compile-time version - -The compile-time version of GLFW is provided by the GLFW header with the -`GLFW_VERSION_MAJOR`, `GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` macros. - -@code -printf("Compiled against GLFW %i.%i.%i\n", - GLFW_VERSION_MAJOR, - GLFW_VERSION_MINOR, - GLFW_VERSION_REVISION); -@endcode - - -@subsection intro_version_runtime Run-time version - -The run-time version can be retrieved with @ref glfwGetVersion, a function that -may be called regardless of whether GLFW is initialized. - -@code -int major, minor, revision; -glfwGetVersion(&major, &minor, &revision); - -printf("Running against GLFW %i.%i.%i\n", major, minor, revision); -@endcode - - -@subsection intro_version_string Version string - -GLFW 3 also provides a compile-time generated version string that describes the -version, platform, compiler and any platform-specific compile-time options. -This is primarily intended for submitting bug reports, to allow developers to -see which code paths are enabled in a binary. - -The version string is returned by @ref glfwGetVersionString, a function that may -be called regardless of whether GLFW is initialized. - -__Do not use the version string__ to parse the GLFW library version. The @ref -glfwGetVersion function already provides the version of the running library -binary. - -The format of the string is as follows: - - The version of GLFW - - The name of the window system API - - The name of the context creation API - - Any additional options or APIs - -For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL -back ends, the version string may look something like this: - -@code -3.0.0 Win32 WGL MinGW -@endcode - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/main.dox b/testbed/nanogui/ext/glfw/docs/main.dox deleted file mode 100644 index e5caae0d..00000000 --- a/testbed/nanogui/ext/glfw/docs/main.dox +++ /dev/null @@ -1,47 +0,0 @@ -/*! - -@mainpage notitle - -@section main_intro Introduction - -__GLFW__ is a free, Open Source, multi-platform library for creating windows -with OpenGL or OpenGL ES contexts and receiving many kinds of input. It is easy -to integrate into existing applications and does not lay claim to the main loop. - -See @ref news_31 for release highlights or the -[version history](http://www.glfw.org/changelog.html) for details. - -@ref quick is a guide for those new to GLFW. It takes you through how to write -a small but complete program. For people coming from GLFW 2, the @ref moving -guide explains what has changed and how to update existing code to use the new -API. - -There are guides for each of the various areas of the API. - - - @ref intro – initialization, error handling and high-level design - - @ref window – creating and working with windows and framebuffers - - @ref context – working with OpenGL and OpenGL ES contexts - - @ref monitor – enumerating and working with monitors and video modes - - @ref input – receiving events, polling and processing input - -Once you have written a program, see the @ref compile and @ref build guides. - -The [reference documentation](modules.html) provides more detailed information -about specific functions. - -There is a section on @ref guarantees_limitations for pointer lifetimes, -reentrancy, thread safety, event order and backward and forward compatibility. - -The @ref rift fills in the gaps for how to use LibOVR with GLFW. - -The [FAQ](http://www.glfw.org/faq.html) answers many common questions about the -design, implementation and use of GLFW. - -Finally, the @ref compat guide explains what APIs, standards and protocols GLFW -uses and what happens when they are not present on a given machine. - -This documentation was generated with Doxygen. The sources for it are available -in both the [source distribution](http://www.glfw.org/download.html) and -[GitHub repository](https://github.com/glfw/glfw). - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/monitor.dox b/testbed/nanogui/ext/glfw/docs/monitor.dox deleted file mode 100644 index 51b9a9f5..00000000 --- a/testbed/nanogui/ext/glfw/docs/monitor.dox +++ /dev/null @@ -1,204 +0,0 @@ -/*! - -@page monitor Monitor guide - -@tableofcontents - -This guide introduces the monitor related functions of GLFW. There are also -guides for the other areas of GLFW. - - - @ref intro - - @ref window - - @ref context - - @ref input - - -@section monitor_object Monitor objects - -A monitor object represents a currently connected monitor and is represented as -a pointer to the [opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type -@ref GLFWmonitor. Monitor objects cannot be created or destroyed by the -application and retain their addresses until the monitors they represent are -disconnected or until the library is [terminated](@ref intro_init_terminate). - -Each monitor has a current video mode, a list of supported video modes, -a virtual position, a human-readable name, an estimated physical size and -a gamma ramp. One of the monitors is the primary monitor. - -The virtual position of a monitor is in -[screen coordinates](@ref coordinate_systems) and, together with the current -video mode, describes the viewports that the connected monitors provide into the -virtual desktop that spans them. - -To see how GLFW views your monitor setup and its available video modes, run the -`monitors` test program. - - -@subsection monitor_monitors Retrieving monitors - -The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is the user's -preferred monitor and is usually the one with global UI elements like task bar -or menu bar. - -@code -GLFWmonitor* primary = glfwGetPrimaryMonitor(); -@endcode - -You can retrieve all currently connected monitors with @ref glfwGetMonitors. -See the reference documentation for the lifetime of the returned array. - -@code -int count; -GLFWmonitor** monitors = glfwGetMonitors(&count); -@endcode - -The primary monitor is always the first monitor in the returned array, but other -monitors may be moved to a different index when a monitor is connected or -disconnected. - - -@subsection monitor_event Monitor configuration changes - -If you wish to be notified when a monitor is connected or disconnected, set -a monitor callback. - -@code -glfwSetMonitorCallback(monitor_callback); -@endcode - -The callback function receives the handle for the monitor that has been -connected or disconnected and a monitor action. - -@code -void monitor_callback(GLFWmonitor* monitor, int event) -{ -} -@endcode - -The action is one of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. - - -@section monitor_properties Monitor properties - -Each monitor has a current video mode, a list of supported video modes, -a virtual position, a human-readable name, an estimated physical size and -a gamma ramp. - - -@subsection monitor_modes Video modes - -GLFW generally does a good job selecting a suitable video mode when you create -a full screen window, but it is sometimes useful to know exactly which video -modes are supported. - -Video modes are represented as @ref GLFWvidmode structures. You can get an -array of the video modes supported by a monitor with @ref glfwGetVideoModes. -See the reference documentation for the lifetime of the returned array. - -@code -int count; -GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); -@endcode - -To get the current video mode of a monitor call @ref glfwGetVideoMode. See the -reference documentation for the lifetime of the returned pointer. - -@code -const GLFWvidmode* mode = glfwGetVideoMode(monitor); -@endcode - -The resolution of a video mode is specified in -[screen coordinates](@ref coordinate_systems), not pixels. - - -@subsection monitor_size Physical size - -The physical size of a monitor in millimetres, or an estimation of it, can be -retrieved with @ref glfwGetMonitorPhysicalSize. This has no relation to its -current _resolution_, i.e. the width and height of its current -[video mode](@ref monitor_modes). - -@code -int widthMM, heightMM; -glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM); -@endcode - -This can, for example, be used together with the current video mode to calculate -the DPI of a monitor. - -@code -const double dpi = mode->width / (widthMM / 25.4); -@endcode - - -@subsection monitor_pos Virtual position - -The position of the monitor on the virtual desktop, in -[screen coordinates](@ref coordinate_systems), can be retrieved with @ref -glfwGetMonitorPos. - -@code -int xpos, ypos; -glfwGetMonitorPos(monitor, &xpos, &ypos); -@endcode - - -@subsection monitor_name Human-readable name - -The human-readable, UTF-8 encoded name of a monitor is returned by @ref -glfwGetMonitorName. See the reference documentation for the lifetime of the -returned string. - -@code -const char* name = glfwGetMonitorName(monitor); -@endcode - -Monitor names are not guaranteed to be unique. Two monitors of the same model -and make may have the same name. Only the monitor handle is guaranteed to be -unique, and only until that monitor is disconnected. - - -@subsection monitor_gamma Gamma ramp - -The gamma ramp of a monitor can be set with @ref glfwSetGammaRamp, which accepts -a monitor handle and a pointer to a @ref GLFWgammaramp structure. - -@code -GLFWgammaramp ramp; -unsigned short red[256], green[256], blue[256]; - -ramp.size = 256; -ramp.red = red; -ramp.green = green; -ramp.blue = blue; - -for (i = 0; i < ramp.size; i++) -{ - // Fill out gamma ramp arrays as desired -} - -glfwSetGammaRamp(monitor, &ramp); -@endcode - -The gamma ramp data is copied before the function returns, so there is no need -to keep it around once the ramp has been set. - -@note It is recommended to use gamma ramps of size 256, as that is the size -supported by all graphics cards on all platforms. - -The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp. See -the reference documentation for the lifetime of the returned structure. - -@code -const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor); -@endcode - -If you wish to set a regular gamma ramp, you can have GLFW calculate it for you -from the desired exponent with @ref glfwSetGamma, which in turn calls @ref -glfwSetGammaRamp with the resulting ramp. - -@code -glfwSetGamma(monitor, 1.0); -@endcode - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/moving.dox b/testbed/nanogui/ext/glfw/docs/moving.dox deleted file mode 100644 index 0e7ed5e3..00000000 --- a/testbed/nanogui/ext/glfw/docs/moving.dox +++ /dev/null @@ -1,494 +0,0 @@ -/*! - -@page moving Moving from GLFW 2 to 3 - -@tableofcontents - -This is a transition guide for moving from GLFW 2 to 3. It describes what has -changed or been removed, but does _not_ include -[new features](@ref news) unless they are required when moving an existing code -base onto the new API. For example, the new multi-monitor functions are -required to create full screen windows with GLFW 3. - - -@section moving_removed Changed and removed features - -@subsection moving_renamed_files Renamed library and header file - -The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to -avoid collisions with the headers of other major versions. Similarly, the GLFW -3 library is named `glfw3,` except when it's installed as a shared library on -Unix-like systems, where it uses the -[soname](https://en.wikipedia.org/wiki/soname) `libglfw.so.3`. - -@par Old syntax -@code -#include -@endcode - -@par New syntax -@code -#include -@endcode - - -@subsection moving_threads Removal of threading functions - -The threading functions have been removed, including the per-thread sleep -function. They were fairly primitive, under-used, poorly integrated and took -time away from the focus of GLFW (i.e. context, input and window). There are -better threading libraries available and native threading support is available -in both [C++11](http://en.cppreference.com/w/cpp/thread) and -[C11](http://en.cppreference.com/w/c/thread), both of which are gaining -traction. - -If you wish to use the C++11 or C11 facilities but your compiler doesn't yet -support them, see the -[TinyThread++](https://gitorious.org/tinythread/tinythreadpp) and -[TinyCThread](https://github.com/tinycthread/tinycthread) projects created by -the original author of GLFW. These libraries implement a usable subset of the -threading APIs in C++11 and C11, and in fact some GLFW 3 test programs use -TinyCThread. - -However, GLFW 3 has better support for _use from multiple threads_ than GLFW -2 had. Contexts can be made current on any thread, although only a single -thread at a time, and the documentation explicitly states which functions may be -used from any thread and which may only be used from the main thread. - -@par Removed functions -`glfwSleep`, `glfwCreateThread`, `glfwDestroyThread`, `glfwWaitThread`, -`glfwGetThreadID`, `glfwCreateMutex`, `glfwDestroyMutex`, `glfwLockMutex`, -`glfwUnlockMutex`, `glfwCreateCond`, `glfwDestroyCond`, `glfwWaitCond`, -`glfwSignalCond`, `glfwBroadcastCond` and `glfwGetNumberOfProcessors`. - - -@subsection moving_image Removal of image and texture loading - -The image and texture loading functions have been removed. They only supported -the Targa image format, making them mostly useful for beginner level examples. -To become of sufficiently high quality to warrant keeping them in GLFW 3, they -would need not only to support other formats, but also modern extensions to -OpenGL texturing. This would either add a number of external -dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions -of these libraries. - -As there already are libraries doing this, it is unnecessary both to duplicate -the work and to tie the duplicate to GLFW. The resulting library would also be -platform-independent, as both OpenGL and stdio are available wherever GLFW is. - -@par Removed functions -`glfwReadImage`, `glfwReadMemoryImage`, `glfwFreeImage`, `glfwLoadTexture2D`, -`glfwLoadMemoryTexture2D` and `glfwLoadTextureImage2D`. - - -@subsection moving_stdcall Removal of GLFWCALL macro - -The `GLFWCALL` macro, which made callback functions use -[__stdcall](http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx) on Windows, -has been removed. GLFW is written in C, not Pascal. Removing this macro means -there's one less thing for application programmers to remember, i.e. the -requirement to mark all callback functions with `GLFWCALL`. It also simplifies -the creation of DLLs and DLL link libraries, as there's no need to explicitly -disable `@n` entry point suffixes. - -@par Old syntax -@code -void GLFWCALL callback_function(...); -@endcode - -@par New syntax -@code -void callback_function(...); -@endcode - - -@subsection moving_window_handles Window handle parameters - -Because GLFW 3 supports multiple windows, window handle parameters have been -added to all window-related GLFW functions and callbacks. The handle of -a newly created window is returned by @ref glfwCreateWindow (formerly -`glfwOpenWindow`). Window handles are pointers to the -[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWwindow. - -@par Old syntax -@code -glfwSetWindowTitle("New Window Title"); -@endcode - -@par New syntax -@code -glfwSetWindowTitle(window, "New Window Title"); -@endcode - - -@subsection moving_monitor Explicit monitor selection - -GLFW 3 provides support for multiple monitors. To request a full screen mode window, -instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the -window to use. The @ref glfwGetPrimaryMonitor function returns the monitor that -GLFW 2 would have selected, but there are many other -[monitor functions](@ref monitor). Monitor handles are pointers to the -[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWmonitor. - -@par Old basic full screen -@code -glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN); -@endcode - -@par New basic full screen -@code -window = glfwCreateWindow(640, 480, "My Window", glfwGetPrimaryMonitor(), NULL); -@endcode - -@note The framebuffer bit depth parameters of `glfwOpenWindow` have been turned -into [window hints](@ref window_hints), but as they have been given -[sane defaults](@ref window_hints_values) you rarely need to set these hints. - - -@subsection moving_autopoll Removal of automatic event polling - -GLFW 3 does not automatically poll for events in @ref glfwSwapBuffers, meaning -you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself. Unlike -buffer swap, which acts on a single window, the event processing functions act -on all windows at once. - -@par Old basic main loop -@code -while (...) -{ - // Process input - // Render output - glfwSwapBuffers(); -} -@endcode - -@par New basic main loop -@code -while (...) -{ - // Process input - // Render output - glfwSwapBuffers(window); - glfwPollEvents(); -} -@endcode - - -@subsection moving_context Explicit context management - -Each GLFW 3 window has its own OpenGL context and only you, the application -programmer, can know which context should be current on which thread at any -given time. Therefore, GLFW 3 leaves that decision to you. - -This means that you need to call @ref glfwMakeContextCurrent after creating -a window before you can call any OpenGL functions. - - -@subsection moving_hidpi Separation of window and framebuffer sizes - -Window positions and sizes now use screen coordinates, which may not be the same -as pixels on machines with high-DPI monitors. This is important as OpenGL uses -pixels, not screen coordinates. For example, the rectangle specified with -`glViewport` needs to use pixels. Therefore, framebuffer size functions have -been added. You can retrieve the size of the framebuffer of a window with @ref -glfwGetFramebufferSize function. A framebuffer size callback has also been -added, which can be set with @ref glfwSetFramebufferSizeCallback. - -@par Old basic viewport setup -@code -glfwGetWindowSize(&width, &height); -glViewport(0, 0, width, height); -@endcode - -@par New basic viewport setup -@code -glfwGetFramebufferSize(window, &width, &height); -glViewport(0, 0, width, height); -@endcode - - -@subsection moving_window_close Window closing changes - -The `GLFW_OPENED` window parameter has been removed. As long as the window has -not been destroyed, whether through @ref glfwDestroyWindow or @ref -glfwTerminate, the window is "open". - -A user attempting to close a window is now just an event like any other. Unlike -GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless -you choose them to be. Each window now has a close flag that is set to -`GL_TRUE` when the user attempts to close that window. By default, nothing else -happens and the window stays visible. It is then up to you to either destroy -the window, take some other action or simply ignore the request. - -You can query the close flag at any time with @ref glfwWindowShouldClose and set -it at any time with @ref glfwSetWindowShouldClose. - -@par Old basic main loop -@code -while (glfwGetWindowParam(GLFW_OPENED)) -{ - ... -} -@endcode - -@par New basic main loop -@code -while (!glfwWindowShouldClose(window)) -{ - ... -} -@endcode - -The close callback no longer returns a value. Instead, it is called after the -close flag has been set so it can override its value, if it chooses to, before -event processing completes. You may however not call @ref glfwDestroyWindow -from the close callback (or any other window related callback). - -@par Old syntax -@code -int GLFWCALL window_close_callback(void); -@endcode - -@par New syntax -@code -void window_close_callback(GLFWwindow* window); -@endcode - -@note GLFW never clears the close flag to `GL_FALSE`, meaning you can use it -for other reasons to close the window as well, for example the user choosing -Quit from an in-game menu. - - -@subsection moving_hints Persistent window hints - -The `glfwOpenWindowHint` function has been renamed to @ref glfwWindowHint. - -Window hints are no longer reset to their default values on window creation, but -instead retain their values until modified by @ref glfwWindowHint or @ref -glfwDefaultWindowHints, or until the library is terminated and re-initialized. - - -@subsection moving_video_modes Video mode enumeration - -Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function -now returns all available modes for a specific monitor instead of requiring you -to guess how large an array you need. The `glfwGetDesktopMode` function, which -had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which -returns the current mode of a monitor. - - -@subsection moving_char_up Removal of character actions - -The action parameter of the [character callback](@ref GLFWcharfun) has been -removed. This was an artefact of the origin of GLFW, i.e. being developed in -English by a Swede. However, many keyboard layouts require more than one key to -produce characters with diacritical marks. Even the Swedish keyboard layout -requires this for uncommon cases like ü. - -@par Old syntax -@code -void GLFWCALL character_callback(int character, int action); -@endcode - -@par New syntax -@code -void character_callback(GLFWwindow* window, int character); -@endcode - - -@subsection moving_cursorpos Cursor position changes - -The `glfwGetMousePos` function has been renamed to @ref glfwGetCursorPos, -`glfwSetMousePos` to @ref glfwSetCursorPos and `glfwSetMousePosCallback` to @ref -glfwSetCursorPosCallback. - -The cursor position is now `double` instead of `int`, both for the direct -functions and for the callback. Some platforms can provide sub-pixel cursor -movement and this data is now passed on to the application where available. On -platforms where this is not provided, the decimal part is zero. - -GLFW 3 only allows you to position the cursor within a window using @ref -glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active. -Unless the window is active, the function fails silently. - - -@subsection moving_wheel Wheel position replaced by scroll offsets - -The `glfwGetMouseWheel` function has been removed. Scrolling is the input of -offsets and has no absolute position. The mouse wheel callback has been -replaced by a [scroll callback](@ref GLFWscrollfun) that receives -two-dimensional floating point scroll offsets. This allows you to receive -precise scroll data from for example modern touchpads. - -@par Old syntax -@code -void GLFWCALL mouse_wheel_callback(int position); -@endcode - -@par New syntax -@code -void scroll_callback(GLFWwindow* window, double xoffset, double yoffset); -@endcode - -@par Removed functions -`glfwGetMouseWheel` - - -@subsection moving_repeat Key repeat action - -The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled -for both keys and characters. A new key action, `GLFW_REPEAT`, has been added -to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press -from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or -`GLFW_RELEASE`. - - -@subsection moving_keys Physical key input - -GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to -the values generated by the current keyboard layout. The tokens are named -according to the values they would have using the standard US layout, but this -is only a convenience, as most programmers are assumed to know that layout. -This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and -is the same key in the same place regardless of what keyboard layouts the users -of your program has. - -The key input facility was never meant for text input, although using it that -way worked slightly better in GLFW 2. If you were using it to input text, you -should be using the character callback instead, on both GLFW 2 and 3. This will -give you the characters being input, as opposed to the keys being pressed. - -GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of -having to remember whether to check for `'a'` or `'A'`, you now check for -`GLFW_KEY_A`. - - -@subsection moving_joystick Joystick function changes - -The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes. - -The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and -`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent -function as well as axis and button counts returned by the @ref -glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions. - - -@subsection moving_mbcs Win32 MBCS support - -The Win32 port of GLFW 3 will not compile in -[MBCS mode](http://msdn.microsoft.com/en-us/library/5z097dxa.aspx). -However, because the use of the Unicode version of the Win32 API doesn't affect -the process as a whole, but only those windows created using it, it's perfectly -possible to call MBCS functions from other parts of the same application. -Therefore, even if an application using GLFW has MBCS mode code, there's no need -for GLFW itself to support it. - - -@subsection moving_windows Support for versions of Windows older than XP - -All explicit support for version of Windows older than XP has been removed. -There is no code that actively prevents GLFW 3 from running on these earlier -versions, but it uses Win32 functions that those versions lack. - -Windows XP was released in 2001, and by now (January 2015) it has not only -replaced almost all earlier versions of Windows, but is itself rapidly being -replaced by Windows 7 and 8. The MSDN library doesn't even provide -documentation for version older than Windows 2000, making it difficult to -maintain compatibility with these versions even if it was deemed worth the -effort. - -The Win32 API has also not stood still, and GLFW 3 uses many functions only -present on Windows XP or later. Even supporting an OS as new as XP (new -from the perspective of GLFW 2, which still supports Windows 95) requires -runtime checking for a number of functions that are present only on modern -version of Windows. - - -@subsection moving_syskeys Capture of system-wide hotkeys - -The ability to disable and capture system-wide hotkeys like Alt+Tab has been -removed. Modern applications, whether they're games, scientific visualisations -or something else, are nowadays expected to be good desktop citizens and allow -these hotkeys to function even when running in full screen mode. - - -@subsection moving_terminate Automatic termination - -GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization, -because `exit` calls registered functions from the calling thread and while it -is permitted to call `exit` from any thread, @ref glfwTerminate may only be -called from the main thread. - -To release all resources allocated by GLFW, you should call @ref glfwTerminate -yourself, from the main thread, before the program terminates. Note that this -destroys all windows not already destroyed with @ref glfwDestroyWindow, -invalidating any window handles you may still have. - - -@subsection moving_glu GLU header inclusion - -GLFW 3 does not by default include the GLU header and GLU itself has been -deprecated by [Khronos](https://en.wikipedia.org/wiki/Khronos_Group). __New -projects should avoid using GLU__, but if you need to compile legacy code that -has been moved to GLFW 3, you can request that the GLFW header includes it by -defining `GLFW_INCLUDE_GLU` before the inclusion of the GLFW header. - -@par Old syntax -@code -#include -@endcode - -@par New syntax -@code -#define GLFW_INCLUDE_GLU -#include -@endcode - - -@section moving_tables Name change tables - - -@subsection moving_renamed_functions Renamed functions - -| GLFW 2 | GLFW 3 | Notes | -| --------------------------- | ----------------------------- | ----- | -| `glfwOpenWindow` | @ref glfwCreateWindow | All channel bit depths are now hints -| `glfwCloseWindow` | @ref glfwDestroyWindow | | -| `glfwOpenWindowHint` | @ref glfwWindowHint | Now accepts all `GLFW_*_BITS` tokens | -| `glfwEnable` | @ref glfwSetInputMode | | -| `glfwDisable` | @ref glfwSetInputMode | | -| `glfwGetMousePos` | @ref glfwGetCursorPos | | -| `glfwSetMousePos` | @ref glfwSetCursorPos | | -| `glfwSetMousePosCallback` | @ref glfwSetCursorPosCallback | | -| `glfwSetMouseWheelCallback` | @ref glfwSetScrollCallback | Accepts two-dimensional scroll offsets as doubles | -| `glfwGetJoystickPos` | @ref glfwGetJoystickAxes | | -| `glfwGetWindowParam` | @ref glfwGetWindowAttrib | | -| `glfwGetGLVersion` | @ref glfwGetWindowAttrib | Use `GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and `GLFW_CONTEXT_REVISION` | -| `glfwGetDesktopMode` | @ref glfwGetVideoMode | Returns the current mode of a monitor | -| `glfwGetJoystickParam` | @ref glfwJoystickPresent | The axis and button counts are provided by @ref glfwGetJoystickAxes and @ref glfwGetJoystickButtons | - -@subsection moving_renamed_tokens Renamed tokens - -| GLFW 2 | GLFW 3 | Notes | -| --------------------------- | ---------------------------- | ----- | -| `GLFW_OPENGL_VERSION_MAJOR` | `GLFW_CONTEXT_VERSION_MAJOR` | Renamed as it applies to OpenGL ES as well | -| `GLFW_OPENGL_VERSION_MINOR` | `GLFW_CONTEXT_VERSION_MINOR` | Renamed as it applies to OpenGL ES as well | -| `GLFW_FSAA_SAMPLES` | `GLFW_SAMPLES` | Renamed to match the OpenGL API | -| `GLFW_ACTIVE` | `GLFW_FOCUSED` | Renamed to match the window focus callback | -| `GLFW_WINDOW_NO_RESIZE` | `GLFW_RESIZABLE` | The default has been inverted | -| `GLFW_MOUSE_CURSOR` | `GLFW_CURSOR` | Used with @ref glfwSetInputMode | -| `GLFW_KEY_ESC` | `GLFW_KEY_ESCAPE` | | -| `GLFW_KEY_DEL` | `GLFW_KEY_DELETE` | | -| `GLFW_KEY_PAGEUP` | `GLFW_KEY_PAGE_UP` | | -| `GLFW_KEY_PAGEDOWN` | `GLFW_KEY_PAGE_DOWN` | | -| `GLFW_KEY_KP_NUM_LOCK` | `GLFW_KEY_NUM_LOCK` | | -| `GLFW_KEY_LCTRL` | `GLFW_KEY_LEFT_CONTROL` | | -| `GLFW_KEY_LSHIFT` | `GLFW_KEY_LEFT_SHIFT` | | -| `GLFW_KEY_LALT` | `GLFW_KEY_LEFT_ALT` | | -| `GLFW_KEY_LSUPER` | `GLFW_KEY_LEFT_SUPER` | | -| `GLFW_KEY_RCTRL` | `GLFW_KEY_RIGHT_CONTROL` | | -| `GLFW_KEY_RSHIFT` | `GLFW_KEY_RIGHT_SHIFT` | | -| `GLFW_KEY_RALT` | `GLFW_KEY_RIGHT_ALT` | | -| `GLFW_KEY_RSUPER` | `GLFW_KEY_RIGHT_SUPER` | | - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/news.dox b/testbed/nanogui/ext/glfw/docs/news.dox deleted file mode 100644 index 8ae36aa1..00000000 --- a/testbed/nanogui/ext/glfw/docs/news.dox +++ /dev/null @@ -1,292 +0,0 @@ -/*! - -@page news New features - -@section news_31 New features in 3.1 - -These are the release highlights. For a full list of changes see the -[version history](http://www.glfw.org/changelog.html). - - -@subsection news_31_cursor Custom mouse cursor images - -GLFW now supports creating and setting both custom cursor images and standard -cursor shapes. They are created with @ref glfwCreateCursor or @ref -glfwCreateStandardCursor, set with @ref glfwSetCursor and destroyed with @ref -glfwDestroyCursor. - -@see @ref cursor_object - - -@subsection news_31_drop Path drop event - -GLFW now provides a callback for receiving the paths of files and directories -dropped onto GLFW windows. The callback is set with @ref glfwSetDropCallback. - -@see @ref path_drop - - -@subsection news_31_emptyevent Main thread wake-up - -GLFW now provides the @ref glfwPostEmptyEvent function for posting an empty -event from another thread to the main thread event queue, causing @ref -glfwWaitEvents to return. - -@see @ref events - - -@subsection news_31_framesize Window frame size query - -GLFW now supports querying the size, on each side, of the frame around the -client area of a window, with @ref glfwGetWindowFrameSize. - -@see [Window size](@ref window_size) - - -@subsection news_31_autoiconify Simultaneous multi-monitor rendering - -GLFW now supports disabling auto-iconification of full screen windows with -the [GLFW_AUTO_ICONIFY](@ref window_hints_wnd) window hint. This is intended -for people building multi-monitor installations, where you need windows to stay -in full screen despite losing input focus. - - -@subsection news_31_floating Floating windows - -GLFW now supports floating windows, also called topmost or always on top, for -easier debugging with the [GLFW_FLOATING](@ref window_hints_wnd) window hint. - - -@subsection news_31_focused Initially unfocused windows - -GLFW now supports preventing a windowed mode window from gaining input focus on -creation, with the [GLFW_FOCUSED](@ref window_hints_wnd) window hint. - - -@subsection news_31_direct Direct access for window attributes and cursor position - -GLFW now queries the window input focus, visibility and iconification attributes -and the cursor position directly instead of returning cached data. - - -@subsection news_31_libovr Better interoperability with Oculus Rift - -GLFW now provides native access functions for the OS level handles corresponding -to monitor objects, as well as a [brief guide](@ref rift). It is also regularly -tested for compatibility with the latest version of LibOVR (0.4.4 on release). - - -@subsection news_31_charmods Character with modifiers callback - -GLFW now provides a callback for character events with modifier key bits. The -callback is set with @ref glfwSetCharModsCallback. Unlike the regular character -callback, this will report character events that will not result in a character -being input, for example if the Control key is held down. - -@see @ref input_char - - -@subsection news_31_single Single buffered framebuffers - -GLFW now supports the creation of single buffered windows, with the -[GLFW_DOUBLEBUFFER](@ref window_hints_fb) window hint. - - -@subsection news_31_glext Macro for including extension header - -GLFW now includes the extension header appropriate for the chosen OpenGL or -OpenGL ES header when [GLFW_INCLUDE_GLEXT](@ref build_macros) is defined. GLFW -does not provide these headers. They must be provided by your development -environment or your OpenGL or OpenGL ES SDK. - - -@subsection news_31_release Context release behaviors - -GLFW now supports controlling whether the pipeline is flushed when a context is -made non-current, with the -[GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref window_hints_ctx) window hint, provided the -machine supports the `GL_KHR_context_flush_control` extension. - - -@subsection news_31_wayland (Experimental) Wayland support - -GLFW now has an _experimental_ Wayland display protocol backend that can be -selected on Linux with a CMake option. - - -@subsection news_31_mir (Experimental) Mir support - -GLFW now has an _experimental_ Mir display server backend that can be selected -on Linux with a CMake option. - - -@section news_30 New features in 3.0 - -These are the release highlights. For a full list of changes see the -[version history](http://www.glfw.org/changelog.html). - - -@subsection news_30_cmake CMake build system - -GLFW now uses the CMake build system instead of the various makefiles and -project files used by earlier versions. CMake is available for all platforms -supported by GLFW, is present in most package systems and can generate -makefiles and/or project files for most popular development environments. - -For more information on how to use CMake, see the -[CMake manual](http://cmake.org/cmake/help/documentation.html). - - -@subsection news_30_multiwnd Multi-window support - -GLFW now supports the creation of multiple windows, each with their own OpenGL -or OpenGL ES context, and all window functions now take a window handle. Event -callbacks are now per-window and are provided with the handle of the window that -received the event. The @ref glfwMakeContextCurrent function has been added to -select which context is current on a given thread. - - -@subsection news_30_multimon Multi-monitor support - -GLFW now explicitly supports multiple monitors. They can be enumerated with -@ref glfwGetMonitors, queried with @ref glfwGetVideoModes, @ref -glfwGetMonitorPos, @ref glfwGetMonitorName and @ref glfwGetMonitorPhysicalSize, -and specified at window creation to make the newly created window full screen on -that specific monitor. - - -@subsection news_30_unicode Unicode support - -All string arguments to GLFW functions and all strings returned by GLFW now use -the UTF-8 encoding. This includes the window title, error string, clipboard -text, monitor and joystick names as well as the extension function arguments (as -ASCII is a subset of UTF-8). - - -@subsection news_30_clipboard Clipboard text I/O - -GLFW now supports reading and writing plain text to and from the system -clipboard, with the @ref glfwGetClipboardString and @ref glfwSetClipboardString -functions. - - -@subsection news_30_gamma Gamma ramp support - -GLFW now supports setting and reading back the gamma ramp of monitors, with the -@ref glfwGetGammaRamp and @ref glfwSetGammaRamp functions. There is also @ref -glfwSetGamma, which generates a ramp from a gamma value and then sets it. - - -@subsection news_30_gles OpenGL ES support - -GLFW now supports the creation of OpenGL ES contexts, by setting the -`GLFW_CLIENT_API` window hint to `GLFW_OPENGL_ES_API`, where creation of such -contexts are supported. Note that GLFW _does not implement_ OpenGL ES, so your -driver must provide support in a way usable by GLFW. Modern Nvidia and Intel -drivers support creation of OpenGL ES context using the GLX and WGL APIs, while -AMD provides an EGL implementation instead. - - -@subsection news_30_egl (Experimental) EGL support - -GLFW now has an experimental EGL context creation back end that can be selected -through CMake options. - - -@subsection news_30_hidpi High-DPI support - -GLFW now supports high-DPI monitors on both Windows and OS X, giving windows full -resolution framebuffers where other UI elements are scaled up. To achieve this, -@ref glfwGetFramebufferSize and @ref glfwSetFramebufferSizeCallback have been -added. These work with pixels, while the rest of the GLFW API works with screen -coordinates. This is important as OpenGL uses pixels, not screen coordinates. - - -@subsection news_30_error Error callback - -GLFW now has an error callback, which can provide your application with much -more detailed diagnostics than was previously possible. The callback is passed -an error code and a description string. - - -@subsection news_30_wndptr Per-window user pointer - -Each window now has a user-defined pointer, retrieved with @ref -glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it -easier to integrate GLFW into C++ code. - - -@subsection news_30_iconifyfun Window iconification callback - -Each window now has a callback for iconification and restoration events, -which is set with @ref glfwSetWindowIconifyCallback. - - -@subsection news_30_wndposfun Window position callback - -Each window now has a callback for position events, which is set with @ref -glfwSetWindowPosCallback. - - -@subsection news_30_wndpos Window position query - -The position of a window can now be retrieved using @ref glfwGetWindowPos. - - -@subsection news_30_focusfun Window focus callback - -Each windows now has a callback for focus events, which is set with @ref -glfwSetWindowFocusCallback. - - -@subsection news_30_enterleave Cursor enter/leave callback - -Each window now has a callback for when the mouse cursor enters or leaves its -client area, which is set with @ref glfwSetCursorEnterCallback. - - -@subsection news_30_wndtitle Initial window title - -The title of a window is now specified at creation time, as one of the arguments -to @ref glfwCreateWindow. - - -@subsection news_30_hidden Hidden windows - -Windows can now be hidden with @ref glfwHideWindow, shown using @ref -glfwShowWindow and created initially hidden with the `GLFW_VISIBLE` window hint. -This allows for off-screen rendering in a way compatible with most drivers, as -well as moving a window to a specific position before showing it. - - -@subsection news_30_undecorated Undecorated windows - -Windowed mode windows can now be created without decorations, i.e. things like -a frame, a title bar, with the `GLFW_DECORATED` window hint. This allows for -the creation of things like splash screens. - - -@subsection news_30_keymods Modifier key bit masks - -[Modifier key bit mask](@ref mods) parameters have been added to the -[mouse button](@ref GLFWmousebuttonfun) and [key](@ref GLFWkeyfun) callbacks. - - -@subsection news_30_scancode Platform-specific scancodes - -A scancode parameter has been added to the [key callback](@ref GLFWkeyfun). Keys -that don't have a [key token](@ref keys) still get passed on with the key -parameter set to `GLFW_KEY_UNKNOWN`. These scancodes will vary between machines -and are intended to be used for key bindings. - - -@subsection news_30_jsname Joystick names - -The name of a joystick can now be retrieved using @ref glfwGetJoystickName. - - -@subsection news_30_doxygen Doxygen documentation - -You are reading it. - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/quick.dox b/testbed/nanogui/ext/glfw/docs/quick.dox deleted file mode 100644 index 12283a15..00000000 --- a/testbed/nanogui/ext/glfw/docs/quick.dox +++ /dev/null @@ -1,328 +0,0 @@ -/*! - -@page quick Getting started - -@tableofcontents - -This guide takes you through writing a simple application using GLFW 3. The -application will create a window and OpenGL context, render a rotating triangle -and exit when the user closes the window or presses Escape. This guide will -introduce a few of the most commonly used functions, but there are many more. - -This guide assumes no experience with earlier versions of GLFW. If you -have used GLFW 2 in the past, read the @ref moving guide, as some functions -behave differently in GLFW 3. - - -@section quick_steps Step by step - -@subsection quick_include Including the GLFW header - -In the source files of your application where you use OpenGL or GLFW, you need -to include the GLFW 3 header file. - -@code -#include -@endcode - -This defines all the constants, types and function prototypes of the GLFW API. -It also includes the OpenGL header, and defines all the constants and types -necessary for it to work on your platform. - -For example, under Windows you are normally required to include `windows.h` -before including `GL/gl.h`. This would make your source file tied to Windows -and pollute your code's namespace with the whole Win32 API. - -Instead, the GLFW header takes care of this for you, not by including -`windows.h`, but rather by itself duplicating only the necessary parts of it. -It does this only where needed, so if `windows.h` _is_ included, the GLFW header -does not try to redefine those symbols. - -In other words: - -- Do _not_ include the OpenGL headers yourself, as GLFW does this for you -- Do _not_ include `windows.h` or other platform-specific headers unless - you plan on using those APIs directly -- If you _do_ need to include such headers, do it _before_ including the - GLFW one and it will detect this - -Starting with version 3.0, the GLU header `glu.h` is no longer included by -default. If you wish to include it, define `GLFW_INCLUDE_GLU` before the -inclusion of the GLFW header. - -@code -#define GLFW_INCLUDE_GLU -#include -@endcode - - -@subsection quick_init_term Initializing and terminating GLFW - -Before you can use most GLFW functions, the library must be initialized. On -successful initialization, `GL_TRUE` is returned. If an error occurred, -`GL_FALSE` is returned. - -@code -if (!glfwInit()) - exit(EXIT_FAILURE); -@endcode - -When you are done using GLFW, typically just before the application exits, you -need to terminate GLFW. - -@code -glfwTerminate(); -@endcode - -This destroys any remaining windows and releases any other resources allocated by -GLFW. After this call, you must initialize GLFW again before using any GLFW -functions that require it. - - -@subsection quick_capture_error Setting an error callback - -Most events are reported through callbacks, whether it's a key being pressed, -a GLFW window being moved, or an error occurring. Callbacks are simply -C functions (or C++ static methods) that are called by GLFW with arguments -describing the event. - -In case a GLFW function fails, an error is reported to the GLFW error callback. -You can receive these reports with an error callback. This function must have -the signature below. This simple error callback just prints the error -description to `stderr`. - -@code -void error_callback(int error, const char* description) -{ - fputs(description, stderr); -} -@endcode - -Callback functions must be set, so GLFW knows to call them. The function to set -the error callback is one of the few GLFW functions that may be called before -initialization, which lets you be notified of errors both during and after -initialization. - -@code -glfwSetErrorCallback(error_callback); -@endcode - - -@subsection quick_create_window Creating a window and context - -The window and its OpenGL context are created with a single call, which returns -a handle to the created combined window and context object. For example, this -creates a 640 by 480 windowed mode window with an OpenGL context: - -@code -GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL); -@endcode - -If window or context creation fails, `NULL` will be returned, so it is necessary -to check the return value. - -@code -if (!window) -{ - glfwTerminate(); - exit(EXIT_FAILURE); -} -@endcode - -The window handle is passed to all window related functions and is provided to -along to all window related callbacks, so they can tell which window received -the event. - -When a window is no longer needed, destroy it. - -@code -glfwDestroyWindow(window); -@endcode - -Once this function is called, no more events will be delivered for that window -and its handle becomes invalid. - - -@subsection quick_context_current Making the OpenGL context current - -Before you can use the OpenGL API, you must have a current OpenGL context. - -@code -glfwMakeContextCurrent(window); -@endcode - -The context will remain current until you make another context current or until -the window owning the current context is destroyed. - - -@subsection quick_window_close Checking the window close flag - -Each window has a flag indicating whether the window should be closed. - -When the user attempts to close the window, either by pressing the close widget -in the title bar or using a key combination like Alt+F4, this flag is set to 1. -Note that __the window isn't actually closed__, so you are expected to monitor -this flag and either destroy the window or give some kind of feedback to the -user. - -@code -while (!glfwWindowShouldClose(window)) -{ - // Keep running -} -@endcode - -You can be notified when the user is attempting to close the window by setting -a close callback with @ref glfwSetWindowCloseCallback. The callback will be -called immediately after the close flag has been set. - -You can also set it yourself with @ref glfwSetWindowShouldClose. This can be -useful if you want to interpret other kinds of input as closing the window, like -for example pressing the escape key. - - -@subsection quick_key_input Receiving input events - -Each window has a large number of callbacks that can be set to receive all the -various kinds of events. To receive key press and release events, create a key -callback function. - -@code -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} -@endcode - -The key callback, like other window related callbacks, are set per-window. - -@code -glfwSetKeyCallback(window, key_callback); -@endcode - -In order for event callbacks to be called when events occur, you need to process -events as described below. - - -@subsection quick_render Rendering with OpenGL - -Once you have a current OpenGL context, you can use OpenGL normally. In this -tutorial, a multi-colored rotating triangle will be rendered. The framebuffer -size needs to be retrieved for `glViewport`. - -@code -int width, height; -glfwGetFramebufferSize(window, &width, &height); -glViewport(0, 0, width, height); -@endcode - -You can also set a framebuffer size callback using @ref -glfwSetFramebufferSizeCallback and call `glViewport` from there. - - -@subsection quick_timer Reading the timer - -To create smooth animation, a time source is needed. GLFW provides a timer that -returns the number of seconds since initialization. The time source used is the -most accurate on each platform and generally has micro- or nanosecond -resolution. - -@code -double time = glfwGetTime(); -@endcode - - -@subsection quick_swap_buffers Swapping buffers - -GLFW windows by default use double buffering. That means that each window has -two rendering buffers; a front buffer and a back buffer. The front buffer is -the one being displayed and the back buffer the one you render to. - -When the entire frame has been rendered, the buffers need to be swapped with one -another, so the back buffer becomes the front buffer and vice versa. - -@code -glfwSwapBuffers(window); -@endcode - -The swap interval indicates how many frames to wait until swapping the buffers, -commonly known as _vsync_. By default, the swap interval is zero, meaning -buffer swapping will occur immediately. On fast machines, many of those frames -will never be seen, as the screen is still only updated typically 60-75 times -per second, so this wastes a lot of CPU and GPU cycles. - -Also, because the buffers will be swapped in the middle the screen update, -leading to [screen tearing](https://en.wikipedia.org/wiki/Screen_tearing). - -For these reasons, applications will typically want to set the swap interval to -one. It can be set to higher values, but this is usually not recommended, -because of the input latency it leads to. - -@code -glfwSwapInterval(1); -@endcode - -This function acts on the current context and will fail unless a context is -current. - - -@subsection quick_process_events Processing events - -GLFW needs to communicate regularly with the window system both in order to -receive events and to show that the application hasn't locked up. Event -processing must be done regularly while you have visible windows and is normally -done each frame after buffer swapping. - -There are two methods for processing pending events; polling and waiting. This -example will use event polling, which processes only those events that have -already been received and then returns immediately. - -@code -glfwPollEvents(); -@endcode - -This is the best choice when rendering continually, like most games do. If -instead you only need to update your rendering once you have received new input, -@ref glfwWaitEvents is a better choice. It waits until at least one event has -been received, putting the thread to sleep in the meantime, and then processes -all received events. This saves a great deal of CPU cycles and is useful for, -for example, many kinds of editing tools. - - -@section quick_example Putting it together - -Now that you know how to initialize GLFW, create a window and poll for -keyboard input, it's possible to create a simple program. - -@snippet simple.c code - -This program creates a 640 by 480 windowed mode window and starts a loop that -clears the screen, renders a triangle and processes events until the user either -presses Escape or closes the window. - -This program uses only a few of the many functions GLFW provides. There are -guides for each of the areas covered by GLFW. Each guide will introduce all the -functions for that category. - - - @ref intro - - @ref window - - @ref context - - @ref monitor - - @ref input - - -@section quick_build Compiling and linking the program - -The complete program above can be found in the source distribution as -`examples/simple.c` and is compiled along with all other examples when you -build GLFW. That is, if you have compiled GLFW then you have already built this -as `simple.exe` on Windows, `simple` on Linux or `simple.app` on OS X. - -This tutorial ends here. Once you have written a program that uses GLFW, you -will need to compile and link it. How to do that depends on the development -environment you are using and is best explained by the documentation for that -environment. To learn about the details that are specific to GLFW, see -@ref build. - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/rift.dox b/testbed/nanogui/ext/glfw/docs/rift.dox deleted file mode 100644 index edf206f7..00000000 --- a/testbed/nanogui/ext/glfw/docs/rift.dox +++ /dev/null @@ -1,199 +0,0 @@ -/*! - -@page rift Oculus Rift guide - -@tableofcontents - -This guide is intended to fill in the gaps between the -[Oculus PC SDK documentation](https://developer.oculus.com/documentation/) and -the rest of the GLFW documentation and is not a replacement for either. It -requires you to use [native access](@ref native) and assumes a certain level of -proficiency with LibOVR, platform specific APIs and your chosen development -environment. - -While GLFW has no explicit support for LibOVR, it is tested with and tries to -interoperate well with it. - -@note Because of the speed of development of the Oculus SDK, this guide may -become outdated before the next release. If this is a local copy of the -documentation, you may want to check the GLFW website for updates. This -revision of the guide is written against version 0.4.4 of the SDK. - - -@section rift_include Including the LibOVR and GLFW header files - -Both the OpenGL LibOVR header and the GLFW native header need macros telling -them what OS you are building for. Because LibOVR only supports three major -desktop platforms, this can be solved with canonical predefined macros. - -@code -#if defined(_WIN32) - #define GLFW_EXPOSE_NATIVE_WIN32 - #define GLFW_EXPOSE_NATIVE_WGL - #define OVR_OS_WIN32 -#elif defined(__APPLE__) - #define GLFW_EXPOSE_NATIVE_COCOA - #define GLFW_EXPOSE_NATIVE_NSGL - #define OVR_OS_MAC -#elif defined(__linux__) - #define GLFW_EXPOSE_NATIVE_X11 - #define GLFW_EXPOSE_NATIVE_GLX - #define OVR_OS_LINUX -#endif - -#include -#include - -#include -@endcode - -Both the GLFW and LibOVR headers by default attempt to include the standard -OpenGL `GL/gl.h` header (`OpenGL/gl.h` on OS X). If you wish to use a different -standard header or an [extension loading library](@ref context_glext_auto), -include that header before these. - - -@section rift_init Initializing LibOVR and GLFW - -LibOVR needs to be initialized before GLFW. This means calling at least -`ovr_Initialize`, `ovrHmd_Create` and `ovrHmd_ConfigureTracking` before @ref -glfwInit. Similarly, LibOVR must be shut down after GLFW. This means calling -`ovrHmd_Destroy` and `ovr_Shutdown` after @ref glfwTerminate. - - -@section rift_direct Direct HMD mode - -Direct HMD mode is the recommended display mode for new applications, but the -Oculus Rift runtime currently (January 2015) only supports this mode on Windows. -In direct mode the HMD is not detectable as a GLFW monitor. - - -@subsection rift_direct_create Creating a window and context - -If the HMD is in direct mode you can use either a full screen or a windowed mode -window, but full screen is only recommended if there is a monitor that supports -the resolution of the HMD. Due to limitations in LibOVR, the size of the client -area of the window must equal the resolution of the HMD. - -If the resolution of the HMD is much larger than the regular monitor, the window -may be resized by the window manager on creation. One way to avoid this is to -make it undecorated with the [GLFW_DECORATED](@ref window_hints_wnd) window -hint. - - -@subsection rift_direct_attach Attaching the window to the HMD - -Once you have created the window and context, you need to attach the native -handle of the GLFW window to the HMD. - -@code -ovrHmd_AttachToWindow(hmd, glfwGetWin32Window(window), NULL, NULL); -@endcode - - -@section rift_extend Extend Desktop mode - -Extend desktop mode is a legacy display mode, but is still (January 2015) the -only available mode on OS X and Linux, as well as on Windows machines that for -technical reasons do not yet support direct HMD mode. - - -@subsection rift_extend_detect Detecting a HMD with GLFW - -If the HMD is in extend desktop mode you can deduce which GLFW monitor it -corresponds to and create a full screen window on that monitor. - -On Windows, the native display device name of a GLFW monitor corresponds to the -display device name of the detected HMD as stored, in the `DisplayDeviceName` -member of `ovrHmdDesc`. - -On OS X, the native display ID of a GLFW monitor corresponds to the display ID -of the detected HMD, as stored in the `DisplayId` member of `ovrHmdDesc`. - -At the time of writing (January 2015), the Oculus SDK does not support detecting -which monitor corresponds to the HMD in any sane fashion, but as long as the HMD -is set up and rotated properly it can be found via the screen position and -resolution provided by LibOVR. This method may instead find another monitor -that is mirroring the HMD, but this only matters if you intend to change its -video mode. - -@code -int i, count; -GLFWmonitor** monitors = glfwGetMonitors(&count); - -for (i = 0; i < count; i++) -{ -#if defined(_WIN32) - if (strcmp(glfwGetWin32Monitor(monitors[i]), hmd->DisplayDeviceName) == 0) - return monitors[i]; -#elif defined(__APPLE__) - if (glfwGetCocoaMonitor(monitors[i]) == hmd->DisplayId) - return monitors[i]; -#elif defined(__linux__) - int xpos, ypos; - const GLFWvidmode* mode = glfwGetVideoMode(monitors[i]); - glfwGetMonitorPos(monitors[i], &xpos, &ypos); - - if (hmd->WindowsPos.x == xpos && - hmd->WindowsPos.y == ypos && - hmd->Resolution.w == mode->width && - hmd->Resolution.h == mode->height) - { - return monitors[i]; - } -#endif -} -@endcode - - -@subsection rift_extend_create Creating a window and context - -The window is created as a regular full screen window on the found monitor. It -is usually a good idea to create a -[windowed full screen](@ref window_windowed_full_screen) window, as the HMD will -very likely already be set to the correct video mode. However, in extend -desktop mode it behaves like a regular monitor and any supported video mode can -be requested. - -If other monitors are mirroring the HMD and you request a different video mode, -all monitors in the mirroring set will get the new video mode. - - -@section rift_render Rendering to the HMD - -@subsection rift_render_sdk SDK distortion rendering - -If you wish to use SDK distortion rendering you will need some information from -GLFW to configure the renderer. Below are the parts of the `ovrGLConfig` union -that need to be filled with from GLFW. Note that there are other fields that -also need to be filled for `ovrHmd_ConfigureRendering` to succeed. - -Before configuring SDK distortion rendering you should make your context -current. - -@code - int width, height; - union ovrGLConfig config; - - glfwGetFramebufferSize(window, &width, &height); - - config.OGL.Header.BackBufferSize.w = width; - config.OGL.Header.BackBufferSize.h = height; -#if defined(_WIN32) - config.OGL.Window = glfwGetWin32Window(window); -#elif defined(__APPLE__) -#elif defined(__linux__) - config.OGL.Disp = glfwGetX11Display(); -#endif -@endcode - -When using SDK distortion rendering you should not swap the buffers yourself, as -the HMD is updated by `ovrHmd_EndFrame`. - - -@subsection rift_render_custom Client distortion rendering - -With client distortion rendering you are in full control of the contents of the -HMD and should render and swap the buffers normally. - -*/ diff --git a/testbed/nanogui/ext/glfw/docs/spaces.svg b/testbed/nanogui/ext/glfw/docs/spaces.svg deleted file mode 100644 index 562fa8be..00000000 --- a/testbed/nanogui/ext/glfw/docs/spaces.svg +++ /dev/null @@ -1,872 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testbed/nanogui/ext/glfw/docs/window.dox b/testbed/nanogui/ext/glfw/docs/window.dox deleted file mode 100644 index 588481e7..00000000 --- a/testbed/nanogui/ext/glfw/docs/window.dox +++ /dev/null @@ -1,803 +0,0 @@ -/*! - -@page window Window guide - -@tableofcontents - -This guide introduces the window related functions of GLFW. There are also -guides for the other areas of GLFW. - - - @ref intro - - @ref context - - @ref monitor - - @ref input - - -@section window_object Window objects - -The @ref GLFWwindow object encapsulates both a window and a context. They are -created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow, or -@ref glfwTerminate, if any remain. As the window and context are inseparably -linked, the object pointer is used as both a context and window handle. - -To see the event stream provided to the various window related callbacks, run -the `events` test program. - - -@subsection window_creation Window creation - -A window and its OpenGL or OpenGL ES context are created with @ref -glfwCreateWindow, which returns a handle to the created window object. For -example, this creates a 640 by 480 windowed mode window: - -@code -GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL); -@endcode - -If window creation fails, `NULL` will be returned, so it is necessary to check -the return value. - -The window handle is passed to all window related functions and is provided to -along with all input events, so event handlers can tell which window received -the event. - - -@subsubsection window_full_screen Full screen windows - -To create a full screen window, you need to specify which monitor the window -should use. In most cases, the user's primary monitor is a good choice. -For more information about retrieving monitors, see @ref monitor_monitors. - -@code -GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL); -@endcode - -Full screen windows cover the entire display area of a monitor, have no border -or decorations. - -Each field of the @ref GLFWvidmode structure corresponds to a function parameter -or window hint and combine to form the _desired video mode_ for that window. -The supported video mode most closely matching the desired video mode will be -set for the chosen monitor as long as the window has input focus. For more -information about retrieving video modes, see @ref monitor_modes. - -Video mode field | Corresponds to ------------------------ | ------------------------ -GLFWvidmode.width | `width` parameter -GLFWvidmode.height | `height` parameter -GLFWvidmode.redBits | `GLFW_RED_BITS` hint -GLFWvidmode.greenBits | `GLFW_GREEN_BITS` hint -GLFWvidmode.blueBits | `GLFW_BLUE_BITS` hint -GLFWvidmode.refreshRate | `GLFW_REFRESH_RATE` hint - -Once you have a full screen window, you can change its resolution with @ref -glfwSetWindowSize. The new video mode will be selected and set the same way as -the video mode chosen by @ref glfwCreateWindow. - -By default, the original video mode of the monitor will be restored and the -window iconified if it loses input focus, to allow the user to switch back to -the desktop. This behavior can be disabled with the `GLFW_AUTO_ICONIFY` window -hint, for example if you wish to simultaneously cover multiple windows with full -screen windows. - - -@subsubsection window_windowed_full_screen "Windowed full screen" windows - -If the closest match for the desired video mode is the current one, the video -mode will not be changed, making window creation faster and application -switching much smoother. This is sometimes called _windowed full screen_ or -_borderless full screen_ window and counts as a full screen window. To create -such a window, simply request the current video mode. - -@code -const GLFWvidmode* mode = glfwGetVideoMode(monitor); - -glfwWindowHint(GLFW_RED_BITS, mode->redBits); -glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); -glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); -glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - -GLFWwindow* window = glfwCreateWindow(mode->width, mode->height, "My Title", monitor, NULL); -@endcode - - -@subsection window_destruction Window destruction - -When a window is no longer needed, destroy it with @ref glfwDestroyWindow. - -@code -glfwDestroyWindow(window); -@endcode - -Window destruction always succeeds. Before the actual destruction, all -callbacks are removed so no further events will be delivered for the window. -All windows remaining when @ref glfwTerminate is called are destroyed as well. - -When a full screen window is destroyed, the original video mode of its monitor -is restored, but the gamma ramp is left untouched. - - -@subsection window_hints Window creation hints - -There are a number of hints that can be set before the creation of a window and -context. Some affect the window itself, others affect the framebuffer or -context. These hints are set to their default values each time the library is -initialized with @ref glfwInit, can be set individually with @ref glfwWindowHint -and reset all at once to their defaults with @ref glfwDefaultWindowHints. - -Note that hints need to be set _before_ the creation of the window and context -you wish to have the specified attributes. - - -@subsubsection window_hints_hard Hard and soft constraints - -Some window hints are hard constraints. These must match the available -capabilities _exactly_ for window and context creation to succeed. Hints -that are not hard constraints are matched as closely as possible, but the -resulting window and context may differ from what these hints requested. To -find out the actual attributes of the created window and context, use the -@ref glfwGetWindowAttrib function. - -The following hints are always hard constraints: -- `GLFW_STEREO` -- `GLFW_DOUBLEBUFFER` -- `GLFW_CLIENT_API` - -The following additional hints are hard constraints when requesting an OpenGL -context, but are ignored when requesting an OpenGL ES context: -- `GLFW_OPENGL_FORWARD_COMPAT` -- `GLFW_OPENGL_PROFILE` - - -@subsubsection window_hints_wnd Window related hints - -`GLFW_RESIZABLE` specifies whether the (windowed mode) window will be resizable -_by the user_. The window will still be resizable using the @ref -glfwSetWindowSize function. This hint is ignored for full screen windows. - -`GLFW_VISIBLE` specifies whether the (windowed mode) window will be initially -visible. This hint is ignored for full screen windows. - -`GLFW_DECORATED` specifies whether the (windowed mode) window will have window -decorations such as a border, a close widget, etc. This hint is ignored for -full screen windows. Note that even though a window may lack a close widget, it -is usually still possible for the user to generate close events. - -`GLFW_FOCUSED` specifies whether the (windowed mode) window will be given input -focus when created. This hint is ignored for full screen and initially hidden -windows. - -`GLFW_AUTO_ICONIFY` specifies whether the (full screen) window will -automatically iconify and restore the previous video mode on input focus loss. -This hint is ignored for windowed mode windows. - -`GLFW_FLOATING` specifies whether the window will be floating above other -regular windows, also called topmost or always-on-top. This is intended -primarily for debugging purposes and cannot be used to implement proper full -screen windows. This hint is ignored for full screen windows. - - -@subsubsection window_hints_fb Framebuffer related hints - -`GLFW_RED_BITS`, `GLFW_GREEN_BITS`, `GLFW_BLUE_BITS`, `GLFW_ALPHA_BITS`, -`GLFW_DEPTH_BITS` and `GLFW_STENCIL_BITS` specify the desired bit depths of the -various components of the default framebuffer. `GLFW_DONT_CARE` means the -application has no preference. - -`GLFW_ACCUM_RED_BITS`, `GLFW_ACCUM_GREEN_BITS`, `GLFW_ACCUM_BLUE_BITS` and -`GLFW_ACCUM_ALPHA_BITS` specify the desired bit depths of the various components -of the accumulation buffer. `GLFW_DONT_CARE` means the application has no -preference. - -@par -Accumulation buffers are a legacy OpenGL feature and should not be used in new -code. - -`GLFW_AUX_BUFFERS` specifies the desired number of auxiliary buffers. -`GLFW_DONT_CARE` means the application has no preference. - -@par -Auxiliary buffers are a legacy OpenGL feature and should not be used in new -code. - -`GLFW_STEREO` specifies whether to use stereoscopic rendering. This is a hard -constraint. - -`GLFW_SAMPLES` specifies the desired number of samples to use for multisampling. -Zero disables multisampling. `GLFW_DONT_CARE` means the application has no -preference. - -`GLFW_SRGB_CAPABLE` specifies whether the framebuffer should be sRGB capable. - -`GLFW_DOUBLEBUFFER` specifies whether the framebuffer should be double buffered. -You nearly always want to use double buffering. This is a hard constraint. - - -@subsubsection window_hints_mtr Monitor related hints - -`GLFW_REFRESH_RATE` specifies the desired refresh rate for full screen windows. -If set to `GLFW_DONT_CARE`, the highest available refresh rate will be used. -This hint is ignored for windowed mode windows. - - -@subsubsection window_hints_ctx Context related hints - -`GLFW_CLIENT_API` specifies which client API to create the context for. -Possible values are `GLFW_OPENGL_API` and `GLFW_OPENGL_ES_API`. This is a hard -constraint. - -`GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` specify the client -API version that the created context must be compatible with. The exact -behavior of these hints depend on the requested client API. - -@par -__OpenGL:__ `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` are not hard -constraints, but creation will fail if the OpenGL version of the created context -is less than the one requested. It is therefore perfectly safe to use the -default of version 1.0 for legacy code and you may still get -backwards-compatible contexts of version 3.0 and above when available. - -@par -While there is no way to ask the driver for a context of the highest supported -version, GLFW will attempt to provide this when you ask for a version 1.0 -context, which is the default for these hints. - -@par -__OpenGL ES:__ `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` are not hard -constraints, but creation will fail if the OpenGL ES version of the created -context is less than the one requested. Additionally, OpenGL ES 1.x cannot be -returned if 2.0 or later was requested, and vice versa. This is because OpenGL -ES 3.x is backward compatible with 2.0, but OpenGL ES 2.0 is not backward -compatible with 1.x. - -`GLFW_OPENGL_FORWARD_COMPAT` specifies whether the OpenGL context should be -forward-compatible, i.e. one where all functionality deprecated in the requested -version of OpenGL is removed. This may only be used if the requested OpenGL -version is 3.0 or above. If OpenGL ES is requested, this hint is ignored. - -@par -Forward-compatibility is described in detail in the -[OpenGL Reference Manual](https://www.opengl.org/registry/). - -`GLFW_OPENGL_DEBUG_CONTEXT` specifies whether to create a debug OpenGL context, -which may have additional error and performance issue reporting functionality. -If OpenGL ES is requested, this hint is ignored. - -`GLFW_OPENGL_PROFILE` specifies which OpenGL profile to create the context for. -Possible values are one of `GLFW_OPENGL_CORE_PROFILE` or -`GLFW_OPENGL_COMPAT_PROFILE`, or `GLFW_OPENGL_ANY_PROFILE` to not request -a specific profile. If requesting an OpenGL version below 3.2, -`GLFW_OPENGL_ANY_PROFILE` must be used. If OpenGL ES is requested, -this hint is ignored. - -@par -OpenGL profiles are described in detail in the -[OpenGL Reference Manual](https://www.opengl.org/registry/). - -`GLFW_CONTEXT_ROBUSTNESS` specifies the robustness strategy to be used by the -context. This can be one of `GLFW_NO_RESET_NOTIFICATION` or -`GLFW_LOSE_CONTEXT_ON_RESET`, or `GLFW_NO_ROBUSTNESS` to not request -a robustness strategy. - -`GLFW_CONTEXT_RELEASE_BEHAVIOR` specifies the release behavior to be -used by the context. Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`, -`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the -behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context -creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`, -the pipeline will be flushed whenever the context is released from being the -current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will -not be flushed on release. - -@par -Context release behaviors are described in detail by the -[GL_KHR_context_flush_control](https://www.opengl.org/registry/specs/KHR/context_flush_control.txt) -extension. - - -@subsubsection window_hints_values Supported and default values - -Window hint | Default value | Supported values -------------------------------- | --------------------------- | ---------------- -`GLFW_RESIZABLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_VISIBLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_DECORATED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_FOCUSED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_AUTO_ICONIFY` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_FLOATING` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_RED_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_GREEN_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_BLUE_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ALPHA_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_DEPTH_BITS` | 24 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_STENCIL_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ACCUM_RED_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ACCUM_GREEN_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ACCUM_BLUE_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ACCUM_ALPHA_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_AUX_BUFFERS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_SAMPLES` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_REFRESH_RATE` | `GLFW_DONT_CARE` | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_STEREO` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_SRGB_CAPABLE` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_DOUBLEBUFFER` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_CLIENT_API` | `GLFW_OPENGL_API` | `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API` -`GLFW_CONTEXT_VERSION_MAJOR` | 1 | Any valid major version number of the chosen client API -`GLFW_CONTEXT_VERSION_MINOR` | 0 | Any valid minor version number of the chosen client API -`GLFW_CONTEXT_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET` -`GLFW_CONTEXT_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE` -`GLFW_OPENGL_FORWARD_COMPAT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_OPENGL_DEBUG_CONTEXT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_OPENGL_PROFILE` | `GLFW_OPENGL_ANY_PROFILE` | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE` - - -@section window_events Window event processing - -See @ref events. - - -@section window_properties Window properties and events - -@subsection window_userptr User pointer - -Each window has a user pointer that can be set with @ref -glfwSetWindowUserPointer and fetched with @ref glfwGetWindowUserPointer. This -can be used for any purpose you need and will not be modified by GLFW throughout -the life-time of the window. - -The initial value of the pointer is `NULL`. - - -@subsection window_close Window closing and close flag - -When the user attempts to close the window, for example by clicking the close -widget or using a key chord like Alt+F4, the _close flag_ of the window is set. -The window is however not actually destroyed and, unless you watch for this -state change, nothing further happens. - -The current state of the close flag is returned by @ref glfwWindowShouldClose -and can be set or cleared directly with @ref glfwSetWindowShouldClose. A common -pattern is to use the close flag as a main loop condition. - -@code -while (!glfwWindowShouldClose(window)) -{ - render(window); - - glfwSwapBuffers(window); - glfwPollEvents(); -} -@endcode - -If you wish to be notified when the user attempts to close a window, set a close -callback. - -@code -glfwSetWindowCloseCallback(window, window_close_callback); -@endcode - -The callback function is called directly _after_ the close flag has been set. -It can be used for example to filter close requests and clear the close flag -again unless certain conditions are met. - -@code -void window_close_callback(GLFWwindow* window) -{ - if (!time_to_close) - glfwSetWindowShouldClose(window, GL_FALSE); -} -@endcode - - -@subsection window_size Window size - -The size of a window can be changed with @ref glfwSetWindowSize. For windowed -mode windows, this sets the size, in -[screen coordinates](@ref coordinate_systems) of the _client area_ or _content -area_ of the window. The window system may impose limits on window size. - -@code -glfwSetWindowSize(window, 640, 480); -@endcode - -For full screen windows, the specified size becomes the new resolution of the -window's *desired video mode*. The video mode most closely matching the new -desired video mode is set immediately. The window is resized to fit the -resolution of the set video mode. - -If you wish to be notified when a window is resized, whether by the user or -the system, set a size callback. - -@code -glfwSetWindowSizeCallback(window, window_size_callback); -@endcode - -The callback function receives the new size, in screen coordinates, of the -client area of the window when it is resized. - -@code -void window_size_callback(GLFWwindow* window, int width, int height) -{ -} -@endcode - -There is also @ref glfwGetWindowSize for directly retrieving the current size of -a window. - -@code -int width, height; -glfwGetWindowSize(window, &width, &height); -@endcode - -@note Do not pass the window size to `glViewport` or other pixel-based OpenGL -calls. The window size is in screen coordinates, not pixels. Use the -[framebuffer size](@ref window_fbsize), which is in pixels, for pixel-based -calls. - -The above functions work with the size of the client area, but decorated windows -typically have title bars and window frames around this rectangle. You can -retrieve the extents of these with @ref glfwGetWindowFrameSize. - -@code -int left, top, right, bottom; -glfwGetWindowFrameSize(window, &left, &top, &right, &bottom); -@endcode - -The returned values are the distances, in screen coordinates, from the edges of -the client area to the corresponding edges of the full window. As they are -distances and not coordinates, they are always zero or positive. - - -@subsection window_fbsize Framebuffer size - -While the size of a window is measured in screen coordinates, OpenGL works with -pixels. The size you pass into `glViewport`, for example, should be in pixels. -On some machines screen coordinates and pixels are the same, but on others they -will not be. There is a second set of functions to retrieve the size, in -pixels, of the framebuffer of a window. - -If you wish to be notified when the framebuffer of a window is resized, whether -by the user or the system, set a size callback. - -@code -glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); -@endcode - -The callback function receives the new size of the framebuffer when it is -resized, which can for example be used to update the OpenGL viewport. - -@code -void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} -@endcode - -There is also @ref glfwGetFramebufferSize for directly retrieving the current -size of the framebuffer of a window. - -@code -int width, height; -glfwGetFramebufferSize(window, &width, &height); -glViewport(0, 0, width, height); -@endcode - -The size of a framebuffer may change independently of the size of a window, for -example if the window is dragged between a regular monitor and a high-DPI one. - - -@subsection window_pos Window position - -The position of a windowed-mode window can be changed with @ref -glfwSetWindowPos. This moves the window so that the upper-left corner of its -client area has the specified [screen coordinates](@ref coordinate_systems). -The window system may put limitations on window placement. - -@code -glfwSetWindowPos(window, 100, 100); -@endcode - -If you wish to be notified when a window is moved, whether by the user, system -or your own code, set a position callback. - -@code -glfwSetWindowPosCallback(window, window_pos_callback); -@endcode - -The callback function receives the new position of the upper-left corner of the -client area when the window is moved. - -@code -void window_pos_callback(GLFWwindow* window, int xpos, int ypos) -{ -} -@endcode - -There is also @ref glfwGetWindowPos for directly retrieving the current position -of the client area of the window. - -@code -int xpos, ypos; -glfwGetWindowPos(window, &xpos, &ypos); -@endcode - - -@subsection window_title Window title - -All GLFW windows have a title, although undecorated or full screen windows may -not display it or only display it in a task bar or similar interface. You can -set a UTF-8 encoded window title with @ref glfwSetWindowTitle. - -@code -glfwSetWindowTitle(window, "My Window"); -@endcode - -The specified string is copied before the function returns, so there is no need -to keep it around. - -As long as your source file is encoded as UTF-8, you can use any Unicode -characters directly in the source. - -@code -glfwSetWindowTitle(window, "おもひでぽろぽろ"); -@endcode - - -@subsection window_monitor Window monitor - -Full screen windows are associated with a specific monitor. You can get the -handle for this monitor with @ref glfwGetWindowMonitor. - -@code -GLFWmonitor* monitor = glfwGetWindowMonitor(window); -@endcode - -This monitor handle is one of those returned by @ref glfwGetMonitors. - -For windowed mode windows, this function returns `NULL`. This is the -recommended way to tell full screen windows from windowed mode windows. - - -@subsection window_iconify Window iconification - -Windows can be iconified (i.e. minimized) with @ref glfwIconifyWindow. - -@code -glfwIconifyWindow(window); -@endcode - -When a full screen window is iconified, the original video mode of its monitor -is restored until the user or application restores the window. - -Iconified windows can be restored with @ref glfwRestoreWindow. - -@code -glfwRestoreWindow(window); -@endcode - -When a full screen window is restored, the desired video mode is restored to its -monitor as well. - -If you wish to be notified when a window is iconified or restored, whether by -the user, system or your own code, set a iconify callback. - -@code -glfwSetWindowIconifyCallback(window, window_iconify_callback); -@endcode - -The callback function receives changes in the iconification state of the window. - -@code -void window_iconify_callback(GLFWwindow* window, int iconified) -{ - if (iconified) - { - // The window was iconified - } - else - { - // The window was restored - } -} -@endcode - -You can also get the current iconification state with @ref glfwGetWindowAttrib. - -@code -int iconified = glfwGetWindowAttrib(window, GLFW_ICONIFIED); -@endcode - - -@subsection window_hide Window visibility - -Windowed mode windows can be hidden with @ref glfwHideWindow. - -@code -glfwHideWindow(window); -@endcode - -This makes the window completely invisible to the user, including removing it -from the task bar, dock or window list. Full screen windows cannot be hidden -and calling @ref glfwHideWindow on a full screen window does nothing. - -Hidden windows can be shown with @ref glfwShowWindow. - -@code -glfwShowWindow(window); -@endcode - -Windowed mode windows can be created initially hidden with the `GLFW_VISIBLE` -[window hint](@ref window_hints_wnd). Windows created hidden are completely -invisible to the user until shown. This can be useful if you need to set up -your window further before showing it, for example moving it to a specific -location. - -You can also get the current visibility state with @ref glfwGetWindowAttrib. - -@code -int visible = glfwGetWindowAttrib(window, GLFW_VISIBLE); -@endcode - - -@subsection window_focus Window input focus - -If you wish to be notified when a window gains or loses input focus, whether by -the user, system or your own code, set a focus callback. - -@code -glfwSetWindowFocusCallback(window, window_focus_callback); -@endcode - -The callback function receives changes in the input focus state of the window. - -@code -void window_focus_callback(GLFWwindow* window, int focused) -{ - if (focused) - { - // The window gained input focus - } - else - { - // The window lost input focus - } -} -@endcode - -You can also get the current input focus state with @ref glfwGetWindowAttrib. - -@code -int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED); -@endcode - - -@subsection window_refresh Window damage and refresh - -If you wish to be notified when the contents of a window is damaged and needs -to be refreshed, set a window refresh callback. - -@code -glfwSetWindowRefreshCallback(m_handle, window_refresh_callback); -@endcode - -The callback function is called when the contents of the window needs to be -refreshed. - -@code -void window_refresh_callback(GLFWwindow* window) -{ - draw_editor_ui(window); - glfwSwapBuffers(window); -} -@endcode - -@note On compositing window systems such as Aero, Compiz or Aqua, where the -window contents are saved off-screen, this callback might only be called when -the window or framebuffer is resized. - - -@subsection window_attribs Window attributes - -Windows have a number of attributes that can be returned using @ref -glfwGetWindowAttrib. Some reflect state that may change during the lifetime of -the window, while others reflect the corresponding hints and are fixed at the -time of creation. Some are related to the actual window and others to its -context. - -@code -if (glfwGetWindowAttrib(window, GLFW_FOCUSED)) -{ - // window has input focus -} -@endcode - - -@subsubsection window_attribs_wnd Window related attributes - -`GLFW_FOCUSED` indicates whether the specified window has input focus. Initial -input focus is controlled by the [window hint](@ref window_hints_wnd) with the -same name. - -`GLFW_ICONIFIED` indicates whether the specified window is iconified, whether by -the user or with @ref glfwIconifyWindow. - -`GLFW_VISIBLE` indicates whether the specified window is visible. Window -visibility can be controlled with @ref glfwShowWindow and @ref glfwHideWindow -and initial visibility is controlled by the [window hint](@ref window_hints_wnd) -with the same name. - -`GLFW_RESIZABLE` indicates whether the specified window is resizable _by the -user_. This is set on creation with the [window hint](@ref window_hints_wnd) - with the same name. - -`GLFW_DECORATED` indicates whether the specified window has decorations such as -a border, a close widget, etc. This is set on creation with the -[window hint](@ref window_hints_wnd) with the same name. - -`GLFW_FLOATING` indicates whether the specified window is floating, also called -topmost or always-on-top. This is controlled by the -[window hint](@ref window_hints_wnd) with the same name. - - -@subsubsection window_attribs_ctx Context related attributes - -`GLFW_CLIENT_API` indicates the client API provided by the window's context; -either `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API`. - -`GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and -`GLFW_CONTEXT_REVISION` indicate the client API version of the window's context. - -`GLFW_OPENGL_FORWARD_COMPAT` is `GL_TRUE` if the window's context is an OpenGL -forward-compatible one, or `GL_FALSE` otherwise. - -`GLFW_OPENGL_DEBUG_CONTEXT` is `GL_TRUE` if the window's context is an OpenGL -debug context, or `GL_FALSE` otherwise. - -`GLFW_OPENGL_PROFILE` indicates the OpenGL profile used by the context. This is -`GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` if the context uses -a known profile, or `GLFW_OPENGL_ANY_PROFILE` if the OpenGL profile is unknown -or the context is an OpenGL ES context. Note that the returned profile may not -match the profile bits of the context flags, as GLFW will try other means of -detecting the profile when no bits are set. - -`GLFW_CONTEXT_ROBUSTNESS` indicates the robustness strategy used by the context. -This is `GLFW_LOSE_CONTEXT_ON_RESET` or `GLFW_NO_RESET_NOTIFICATION` if the -window's context supports robustness, or `GLFW_NO_ROBUSTNESS` otherwise. - - -@section buffer_swap Buffer swapping - -GLFW windows are by default double buffered. That means that you have two -rendering buffers; a front buffer and a back buffer. The front buffer is -the one being displayed and the back buffer the one you render to. - -When the entire frame has been rendered, it is time to swap the back and the -front buffers in order to display what has been rendered and begin rendering -a new frame. This is done with @ref glfwSwapBuffers. - -@code -glfwSwapBuffers(window); -@endcode - -Sometimes it can be useful to select when the buffer swap will occur. With the -function @ref glfwSwapInterval it is possible to select the minimum number of -monitor refreshes the driver wait should from the time @ref glfwSwapBuffers was -called before swapping the buffers: - -@code -glfwSwapInterval(1); -@endcode - -If the interval is zero, the swap will take place immediately when @ref -glfwSwapBuffers is called without waiting for a refresh. Otherwise at least -interval retraces will pass between each buffer swap. Using a swap interval of -zero can be useful for benchmarking purposes, when it is not desirable to -measure the time it takes to wait for the vertical retrace. However, a swap -interval of one lets you avoid tearing. - -Note that this may not work on all machines, as some drivers have -user-controlled settings that override any swap interval the application -requests. It is also by default disabled on Windows Vista and later when using -DWM (Aero), as using it there sometimes leads to severe jitter. You can -forcibly enable it for machines using DWM using @ref compile_options_win32. - -*/ diff --git a/testbed/nanogui/ext/glfw/examples/CMakeLists.txt b/testbed/nanogui/ext/glfw/examples/CMakeLists.txt deleted file mode 100644 index 1232279d..00000000 --- a/testbed/nanogui/ext/glfw/examples/CMakeLists.txt +++ /dev/null @@ -1,82 +0,0 @@ - -link_libraries(glfw "${OPENGL_glu_LIBRARY}") - -if (BUILD_SHARED_LIBS) - add_definitions(-DGLFW_DLL) - link_libraries("${OPENGL_gl_LIBRARY}" "${MATH_LIBRARY}") -else() - link_libraries(${glfw_LIBRARIES}) -endif() - -include_directories("${GLFW_SOURCE_DIR}/include" - "${GLFW_SOURCE_DIR}/deps") - -if ("${OPENGL_INCLUDE_DIR}") - include_directories("${OPENGL_INCLUDE_DIR}") -endif() - -set(GLAD "${GLFW_SOURCE_DIR}/deps/glad/glad.h" - "${GLFW_SOURCE_DIR}/deps/glad.c") -set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" - "${GLFW_SOURCE_DIR}/deps/getopt.c") -set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" - "${GLFW_SOURCE_DIR}/deps/tinycthread.c") - -if (APPLE) - # Set fancy names for bundles - add_executable(Boing MACOSX_BUNDLE boing.c) - add_executable(Gears MACOSX_BUNDLE gears.c) - add_executable(Heightmap MACOSX_BUNDLE heightmap.c ${GLAD}) - add_executable(Particles MACOSX_BUNDLE particles.c ${TINYCTHREAD}) - add_executable(Simple MACOSX_BUNDLE simple.c) - add_executable(SplitView MACOSX_BUNDLE splitview.c) - add_executable(Wave MACOSX_BUNDLE wave.c) - - set_target_properties(Boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing") - set_target_properties(Gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears") - set_target_properties(Heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap") - set_target_properties(Particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles") - set_target_properties(Simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple") - set_target_properties(SplitView PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Split View") - set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave") - - set_target_properties(Boing Gears Heightmap Particles Simple SplitView Wave PROPERTIES - FOLDER "GLFW3/Examples" - MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/AppleInfo.plist") - -else() - # Set boring names for executables - add_executable(boing WIN32 boing.c) - add_executable(gears WIN32 gears.c) - add_executable(heightmap WIN32 heightmap.c ${GLAD}) - add_executable(particles WIN32 particles.c ${TINYCTHREAD} ${GETOPT}) - add_executable(simple WIN32 simple.c) - add_executable(splitview WIN32 splitview.c) - add_executable(wave WIN32 wave.c) - - set_target_properties(boing gears heightmap particles simple splitview wave PROPERTIES - FOLDER "GLFW3/Examples") -endif() - -if (APPLE) - target_link_libraries(Particles "${CMAKE_THREAD_LIBS_INIT}") -elseif (UNIX) - target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") -endif() - -if (MSVC) - set(WINDOWS_BINARIES boing gears heightmap particles simple splitview wave) - - # Tell MSVC to use main instead of WinMain for Windows subsystem executables - set_target_properties(${WINDOWS_BINARIES} PROPERTIES - LINK_FLAGS "/ENTRY:mainCRTStartup") -endif() - -if (APPLE) - set(BUNDLE_BINARIES Boing Gears Heightmap Particles Simple SplitView Wave) - - set_target_properties(${BUNDLE_BINARIES} PROPERTIES - MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}) -endif() - diff --git a/testbed/nanogui/ext/glfw/examples/boing.c b/testbed/nanogui/ext/glfw/examples/boing.c deleted file mode 100644 index ec313596..00000000 --- a/testbed/nanogui/ext/glfw/examples/boing.c +++ /dev/null @@ -1,669 +0,0 @@ -/***************************************************************************** - * Title: GLBoing - * Desc: Tribute to Amiga Boing. - * Author: Jim Brooks - * Original Amiga authors were R.J. Mical and Dale Luck. - * GLFW conversion by Marcus Geelnard - * Notes: - 360' = 2*PI [radian] - * - * - Distances between objects are created by doing a relative - * Z translations. - * - * - Although OpenGL enticingly supports alpha-blending, - * the shadow of the original Boing didn't affect the color - * of the grid. - * - * - [Marcus] Changed timing scheme from interval driven to frame- - * time based animation steps (which results in much smoother - * movement) - * - * History of Amiga Boing: - * - * Boing was demonstrated on the prototype Amiga (codenamed "Lorraine") in - * 1985. According to legend, it was written ad-hoc in one night by - * R. J. Mical and Dale Luck. Because the bouncing ball animation was so fast - * and smooth, attendees did not believe the Amiga prototype was really doing - * the rendering. Suspecting a trick, they began looking around the booth for - * a hidden computer or VCR. - *****************************************************************************/ - -#include -#include -#include - -#define GLFW_INCLUDE_GLU -#include - - -/***************************************************************************** - * Various declarations and macros - *****************************************************************************/ - -/* Prototypes */ -void init( void ); -void display( void ); -void reshape( GLFWwindow* window, int w, int h ); -void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods ); -void mouse_button_callback( GLFWwindow* window, int button, int action, int mods ); -void cursor_position_callback( GLFWwindow* window, double x, double y ); -void DrawBoingBall( void ); -void BounceBall( double dt ); -void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi ); -void DrawGrid( void ); - -#define RADIUS 70.f -#define STEP_LONGITUDE 22.5f /* 22.5 makes 8 bands like original Boing */ -#define STEP_LATITUDE 22.5f - -#define DIST_BALL (RADIUS * 2.f + RADIUS * 0.1f) - -#define VIEW_SCENE_DIST (DIST_BALL * 3.f + 200.f)/* distance from viewer to middle of boing area */ -#define GRID_SIZE (RADIUS * 4.5f) /* length (width) of grid */ -#define BOUNCE_HEIGHT (RADIUS * 2.1f) -#define BOUNCE_WIDTH (RADIUS * 2.1f) - -#define SHADOW_OFFSET_X -20.f -#define SHADOW_OFFSET_Y 10.f -#define SHADOW_OFFSET_Z 0.f - -#define WALL_L_OFFSET 0.f -#define WALL_R_OFFSET 5.f - -/* Animation speed (50.0 mimics the original GLUT demo speed) */ -#define ANIMATION_SPEED 50.f - -/* Maximum allowed delta time per physics iteration */ -#define MAX_DELTA_T 0.02f - -/* Draw ball, or its shadow */ -typedef enum { DRAW_BALL, DRAW_BALL_SHADOW } DRAW_BALL_ENUM; - -/* Vertex type */ -typedef struct {float x; float y; float z;} vertex_t; - -/* Global vars */ -int width, height; -GLfloat deg_rot_y = 0.f; -GLfloat deg_rot_y_inc = 2.f; -GLboolean override_pos = GL_FALSE; -GLfloat cursor_x = 0.f; -GLfloat cursor_y = 0.f; -GLfloat ball_x = -RADIUS; -GLfloat ball_y = -RADIUS; -GLfloat ball_x_inc = 1.f; -GLfloat ball_y_inc = 2.f; -DRAW_BALL_ENUM drawBallHow; -double t; -double t_old = 0.f; -double dt; - -/* Random number generator */ -#ifndef RAND_MAX - #define RAND_MAX 4095 -#endif - -/* PI */ -#ifndef M_PI - #define M_PI 3.1415926535897932384626433832795 -#endif - - -/***************************************************************************** - * Truncate a degree. - *****************************************************************************/ -GLfloat TruncateDeg( GLfloat deg ) -{ - if ( deg >= 360.f ) - return (deg - 360.f); - else - return deg; -} - -/***************************************************************************** - * Convert a degree (360-based) into a radian. - * 360' = 2 * PI - *****************************************************************************/ -double deg2rad( double deg ) -{ - return deg / 360 * (2 * M_PI); -} - -/***************************************************************************** - * 360' sin(). - *****************************************************************************/ -double sin_deg( double deg ) -{ - return sin( deg2rad( deg ) ); -} - -/***************************************************************************** - * 360' cos(). - *****************************************************************************/ -double cos_deg( double deg ) -{ - return cos( deg2rad( deg ) ); -} - -/***************************************************************************** - * Compute a cross product (for a normal vector). - * - * c = a x b - *****************************************************************************/ -void CrossProduct( vertex_t a, vertex_t b, vertex_t c, vertex_t *n ) -{ - GLfloat u1, u2, u3; - GLfloat v1, v2, v3; - - u1 = b.x - a.x; - u2 = b.y - a.y; - u3 = b.y - a.z; - - v1 = c.x - a.x; - v2 = c.y - a.y; - v3 = c.z - a.z; - - n->x = u2 * v3 - v2 * v3; - n->y = u3 * v1 - v3 * u1; - n->z = u1 * v2 - v1 * u2; -} - -/***************************************************************************** - * Calculate the angle to be passed to gluPerspective() so that a scene - * is visible. This function originates from the OpenGL Red Book. - * - * Parms : size - * The size of the segment when the angle is intersected at "dist" - * (ie at the outermost edge of the angle of vision). - * - * dist - * Distance from viewpoint to scene. - *****************************************************************************/ -GLfloat PerspectiveAngle( GLfloat size, - GLfloat dist ) -{ - GLfloat radTheta, degTheta; - - radTheta = 2.f * (GLfloat) atan2( size / 2.f, dist ); - degTheta = (180.f * radTheta) / (GLfloat) M_PI; - return degTheta; -} - - - -#define BOING_DEBUG 0 - - -/***************************************************************************** - * init() - *****************************************************************************/ -void init( void ) -{ - /* - * Clear background. - */ - glClearColor( 0.55f, 0.55f, 0.55f, 0.f ); - - glShadeModel( GL_FLAT ); -} - - -/***************************************************************************** - * display() - *****************************************************************************/ -void display(void) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - glPushMatrix(); - - drawBallHow = DRAW_BALL_SHADOW; - DrawBoingBall(); - - DrawGrid(); - - drawBallHow = DRAW_BALL; - DrawBoingBall(); - - glPopMatrix(); - glFlush(); -} - - -/***************************************************************************** - * reshape() - *****************************************************************************/ -void reshape( GLFWwindow* window, int w, int h ) -{ - glViewport( 0, 0, (GLsizei)w, (GLsizei)h ); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - - gluPerspective( PerspectiveAngle( RADIUS * 2, 200 ), - (GLfloat)w / (GLfloat)h, - 1.0, - VIEW_SCENE_DIST ); - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - - gluLookAt( 0.0, 0.0, VIEW_SCENE_DIST,/* eye */ - 0.0, 0.0, 0.0, /* center of vision */ - 0.0, -1.0, 0.0 ); /* up vector */ -} - -void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods ) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -static void set_ball_pos ( GLfloat x, GLfloat y ) -{ - ball_x = (width / 2) - x; - ball_y = y - (height / 2); -} - -void mouse_button_callback( GLFWwindow* window, int button, int action, int mods ) -{ - if (button != GLFW_MOUSE_BUTTON_LEFT) - return; - - if (action == GLFW_PRESS) - { - override_pos = GL_TRUE; - set_ball_pos(cursor_x, cursor_y); - } - else - { - override_pos = GL_FALSE; - } -} - -void cursor_position_callback( GLFWwindow* window, double x, double y ) -{ - cursor_x = (float) x; - cursor_y = (float) y; - - if ( override_pos ) - set_ball_pos(cursor_x, cursor_y); -} - -/***************************************************************************** - * Draw the Boing ball. - * - * The Boing ball is sphere in which each facet is a rectangle. - * Facet colors alternate between red and white. - * The ball is built by stacking latitudinal circles. Each circle is composed - * of a widely-separated set of points, so that each facet is noticably large. - *****************************************************************************/ -void DrawBoingBall( void ) -{ - GLfloat lon_deg; /* degree of longitude */ - double dt_total, dt2; - - glPushMatrix(); - glMatrixMode( GL_MODELVIEW ); - - /* - * Another relative Z translation to separate objects. - */ - glTranslatef( 0.0, 0.0, DIST_BALL ); - - /* Update ball position and rotation (iterate if necessary) */ - dt_total = dt; - while( dt_total > 0.0 ) - { - dt2 = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total; - dt_total -= dt2; - BounceBall( dt2 ); - deg_rot_y = TruncateDeg( deg_rot_y + deg_rot_y_inc*((float)dt2*ANIMATION_SPEED) ); - } - - /* Set ball position */ - glTranslatef( ball_x, ball_y, 0.0 ); - - /* - * Offset the shadow. - */ - if ( drawBallHow == DRAW_BALL_SHADOW ) - { - glTranslatef( SHADOW_OFFSET_X, - SHADOW_OFFSET_Y, - SHADOW_OFFSET_Z ); - } - - /* - * Tilt the ball. - */ - glRotatef( -20.0, 0.0, 0.0, 1.0 ); - - /* - * Continually rotate ball around Y axis. - */ - glRotatef( deg_rot_y, 0.0, 1.0, 0.0 ); - - /* - * Set OpenGL state for Boing ball. - */ - glCullFace( GL_FRONT ); - glEnable( GL_CULL_FACE ); - glEnable( GL_NORMALIZE ); - - /* - * Build a faceted latitude slice of the Boing ball, - * stepping same-sized vertical bands of the sphere. - */ - for ( lon_deg = 0; - lon_deg < 180; - lon_deg += STEP_LONGITUDE ) - { - /* - * Draw a latitude circle at this longitude. - */ - DrawBoingBallBand( lon_deg, - lon_deg + STEP_LONGITUDE ); - } - - glPopMatrix(); - - return; -} - - -/***************************************************************************** - * Bounce the ball. - *****************************************************************************/ -void BounceBall( double delta_t ) -{ - GLfloat sign; - GLfloat deg; - - if ( override_pos ) - return; - - /* Bounce on walls */ - if ( ball_x > (BOUNCE_WIDTH/2 + WALL_R_OFFSET ) ) - { - ball_x_inc = -0.5f - 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX; - deg_rot_y_inc = -deg_rot_y_inc; - } - if ( ball_x < -(BOUNCE_HEIGHT/2 + WALL_L_OFFSET) ) - { - ball_x_inc = 0.5f + 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX; - deg_rot_y_inc = -deg_rot_y_inc; - } - - /* Bounce on floor / roof */ - if ( ball_y > BOUNCE_HEIGHT/2 ) - { - ball_y_inc = -0.75f - 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX; - } - if ( ball_y < -BOUNCE_HEIGHT/2*0.85 ) - { - ball_y_inc = 0.75f + 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX; - } - - /* Update ball position */ - ball_x += ball_x_inc * ((float)delta_t*ANIMATION_SPEED); - ball_y += ball_y_inc * ((float)delta_t*ANIMATION_SPEED); - - /* - * Simulate the effects of gravity on Y movement. - */ - if ( ball_y_inc < 0 ) sign = -1.0; else sign = 1.0; - - deg = (ball_y + BOUNCE_HEIGHT/2) * 90 / BOUNCE_HEIGHT; - if ( deg > 80 ) deg = 80; - if ( deg < 10 ) deg = 10; - - ball_y_inc = sign * 4.f * (float) sin_deg( deg ); -} - - -/***************************************************************************** - * Draw a faceted latitude band of the Boing ball. - * - * Parms: long_lo, long_hi - * Low and high longitudes of slice, resp. - *****************************************************************************/ -void DrawBoingBallBand( GLfloat long_lo, - GLfloat long_hi ) -{ - vertex_t vert_ne; /* "ne" means south-east, so on */ - vertex_t vert_nw; - vertex_t vert_sw; - vertex_t vert_se; - vertex_t vert_norm; - GLfloat lat_deg; - static int colorToggle = 0; - - /* - * Iterate thru the points of a latitude circle. - * A latitude circle is a 2D set of X,Z points. - */ - for ( lat_deg = 0; - lat_deg <= (360 - STEP_LATITUDE); - lat_deg += STEP_LATITUDE ) - { - /* - * Color this polygon with red or white. - */ - if ( colorToggle ) - glColor3f( 0.8f, 0.1f, 0.1f ); - else - glColor3f( 0.95f, 0.95f, 0.95f ); -#if 0 - if ( lat_deg >= 180 ) - if ( colorToggle ) - glColor3f( 0.1f, 0.8f, 0.1f ); - else - glColor3f( 0.5f, 0.5f, 0.95f ); -#endif - colorToggle = ! colorToggle; - - /* - * Change color if drawing shadow. - */ - if ( drawBallHow == DRAW_BALL_SHADOW ) - glColor3f( 0.35f, 0.35f, 0.35f ); - - /* - * Assign each Y. - */ - vert_ne.y = vert_nw.y = (float) cos_deg(long_hi) * RADIUS; - vert_sw.y = vert_se.y = (float) cos_deg(long_lo) * RADIUS; - - /* - * Assign each X,Z with sin,cos values scaled by latitude radius indexed by longitude. - * Eg, long=0 and long=180 are at the poles, so zero scale is sin(longitude), - * while long=90 (sin(90)=1) is at equator. - */ - vert_ne.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_se.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo )); - vert_nw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_sw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo )); - - vert_ne.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_se.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo )); - vert_nw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_sw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo )); - - /* - * Draw the facet. - */ - glBegin( GL_POLYGON ); - - CrossProduct( vert_ne, vert_nw, vert_sw, &vert_norm ); - glNormal3f( vert_norm.x, vert_norm.y, vert_norm.z ); - - glVertex3f( vert_ne.x, vert_ne.y, vert_ne.z ); - glVertex3f( vert_nw.x, vert_nw.y, vert_nw.z ); - glVertex3f( vert_sw.x, vert_sw.y, vert_sw.z ); - glVertex3f( vert_se.x, vert_se.y, vert_se.z ); - - glEnd(); - -#if BOING_DEBUG - printf( "----------------------------------------------------------- \n" ); - printf( "lat = %f long_lo = %f long_hi = %f \n", lat_deg, long_lo, long_hi ); - printf( "vert_ne x = %.8f y = %.8f z = %.8f \n", vert_ne.x, vert_ne.y, vert_ne.z ); - printf( "vert_nw x = %.8f y = %.8f z = %.8f \n", vert_nw.x, vert_nw.y, vert_nw.z ); - printf( "vert_se x = %.8f y = %.8f z = %.8f \n", vert_se.x, vert_se.y, vert_se.z ); - printf( "vert_sw x = %.8f y = %.8f z = %.8f \n", vert_sw.x, vert_sw.y, vert_sw.z ); -#endif - - } - - /* - * Toggle color so that next band will opposite red/white colors than this one. - */ - colorToggle = ! colorToggle; - - /* - * This circular band is done. - */ - return; -} - - -/***************************************************************************** - * Draw the purple grid of lines, behind the Boing ball. - * When the Workbench is dropped to the bottom, Boing shows 12 rows. - *****************************************************************************/ -void DrawGrid( void ) -{ - int row, col; - const int rowTotal = 12; /* must be divisible by 2 */ - const int colTotal = rowTotal; /* must be same as rowTotal */ - const GLfloat widthLine = 2.0; /* should be divisible by 2 */ - const GLfloat sizeCell = GRID_SIZE / rowTotal; - const GLfloat z_offset = -40.0; - GLfloat xl, xr; - GLfloat yt, yb; - - glPushMatrix(); - glDisable( GL_CULL_FACE ); - - /* - * Another relative Z translation to separate objects. - */ - glTranslatef( 0.0, 0.0, DIST_BALL ); - - /* - * Draw vertical lines (as skinny 3D rectangles). - */ - for ( col = 0; col <= colTotal; col++ ) - { - /* - * Compute co-ords of line. - */ - xl = -GRID_SIZE / 2 + col * sizeCell; - xr = xl + widthLine; - - yt = GRID_SIZE / 2; - yb = -GRID_SIZE / 2 - widthLine; - - glBegin( GL_POLYGON ); - - glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */ - - glVertex3f( xr, yt, z_offset ); /* NE */ - glVertex3f( xl, yt, z_offset ); /* NW */ - glVertex3f( xl, yb, z_offset ); /* SW */ - glVertex3f( xr, yb, z_offset ); /* SE */ - - glEnd(); - } - - /* - * Draw horizontal lines (as skinny 3D rectangles). - */ - for ( row = 0; row <= rowTotal; row++ ) - { - /* - * Compute co-ords of line. - */ - yt = GRID_SIZE / 2 - row * sizeCell; - yb = yt - widthLine; - - xl = -GRID_SIZE / 2; - xr = GRID_SIZE / 2 + widthLine; - - glBegin( GL_POLYGON ); - - glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */ - - glVertex3f( xr, yt, z_offset ); /* NE */ - glVertex3f( xl, yt, z_offset ); /* NW */ - glVertex3f( xl, yb, z_offset ); /* SW */ - glVertex3f( xr, yb, z_offset ); /* SE */ - - glEnd(); - } - - glPopMatrix(); - - return; -} - - -/*======================================================================* - * main() - *======================================================================*/ - -int main( void ) -{ - GLFWwindow* window; - - /* Init GLFW */ - if( !glfwInit() ) - exit( EXIT_FAILURE ); - - glfwWindowHint(GLFW_DEPTH_BITS, 16); - - window = glfwCreateWindow( 400, 400, "Boing (classic Amiga demo)", NULL, NULL ); - if (!window) - { - glfwTerminate(); - exit( EXIT_FAILURE ); - } - - glfwSetFramebufferSizeCallback(window, reshape); - glfwSetKeyCallback(window, key_callback); - glfwSetMouseButtonCallback(window, mouse_button_callback); - glfwSetCursorPosCallback(window, cursor_position_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval( 1 ); - - glfwGetFramebufferSize(window, &width, &height); - reshape(window, width, height); - - glfwSetTime( 0.0 ); - - init(); - - /* Main loop */ - for (;;) - { - /* Timing */ - t = glfwGetTime(); - dt = t - t_old; - t_old = t; - - /* Draw one frame */ - display(); - - /* Swap buffers */ - glfwSwapBuffers(window); - glfwPollEvents(); - - /* Check if we are still running */ - if (glfwWindowShouldClose(window)) - break; - } - - glfwTerminate(); - exit( EXIT_SUCCESS ); -} - diff --git a/testbed/nanogui/ext/glfw/examples/gears.c b/testbed/nanogui/ext/glfw/examples/gears.c deleted file mode 100644 index 2d445964..00000000 --- a/testbed/nanogui/ext/glfw/examples/gears.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * 3-D gear wheels. This program is in the public domain. - * - * Command line options: - * -info print GL implementation information - * -exit automatically exit after 30 seconds - * - * - * Brian Paul - * - * - * Marcus Geelnard: - * - Conversion to GLFW - * - Time based rendering (frame rate independent) - * - Slightly modified camera that should work better for stereo viewing - * - * - * Camilla Berglund: - * - Removed FPS counter (this is not a benchmark) - * - Added a few comments - * - Enabled vsync - */ - - -#include -#include -#include -#include -#include - -#ifndef M_PI -#define M_PI 3.141592654 -#endif - -/* If non-zero, the program exits after that many seconds - */ -static int autoexit = 0; - -/** - - Draw a gear wheel. You'll probably want to call this function when - building a display list since we do a lot of trig here. - - Input: inner_radius - radius of hole at center - outer_radius - radius at center of teeth - width - width of gear teeth - number of teeth - tooth_depth - depth of tooth - - **/ - -static void -gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth / 2.f; - r2 = outer_radius + tooth_depth / 2.f; - - da = 2.f * (float) M_PI / teeth / 4.f; - - glShadeModel(GL_FLAT); - - glNormal3f(0.f, 0.f, 1.f); - - /* draw front face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - if (i < teeth) { - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - } - } - glEnd(); - - /* draw front sides of teeth */ - glBegin(GL_QUADS); - da = 2.f * (float) M_PI / teeth / 4.f; - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - } - glEnd(); - - glNormal3f(0.0, 0.0, -1.0); - - /* draw back face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - if (i < teeth) { - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - } - } - glEnd(); - - /* draw back sides of teeth */ - glBegin(GL_QUADS); - da = 2.f * (float) M_PI / teeth / 4.f; - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), -width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), -width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - } - glEnd(); - - /* draw outward faces of teeth */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - u = r2 * (float) cos(angle + da) - r1 * (float) cos(angle); - v = r2 * (float) sin(angle + da) - r1 * (float) sin(angle); - len = (float) sqrt(u * u + v * v); - u /= len; - v /= len; - glNormal3f(v, -u, 0.0); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), -width * 0.5f); - glNormal3f((float) cos(angle), (float) sin(angle), 0.f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), -width * 0.5f); - u = r1 * (float) cos(angle + 3 * da) - r2 * (float) cos(angle + 2 * da); - v = r1 * (float) sin(angle + 3 * da) - r2 * (float) sin(angle + 2 * da); - glNormal3f(v, -u, 0.f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glNormal3f((float) cos(angle), (float) sin(angle), 0.f); - } - - glVertex3f(r1 * (float) cos(0), r1 * (float) sin(0), width * 0.5f); - glVertex3f(r1 * (float) cos(0), r1 * (float) sin(0), -width * 0.5f); - - glEnd(); - - glShadeModel(GL_SMOOTH); - - /* draw inside radius cylinder */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glNormal3f(-(float) cos(angle), -(float) sin(angle), 0.f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - } - glEnd(); - -} - - -static GLfloat view_rotx = 20.f, view_roty = 30.f, view_rotz = 0.f; -static GLint gear1, gear2, gear3; -static GLfloat angle = 0.f; - -/* OpenGL draw function & timing */ -static void draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - glRotatef(view_rotx, 1.0, 0.0, 0.0); - glRotatef(view_roty, 0.0, 1.0, 0.0); - glRotatef(view_rotz, 0.0, 0.0, 1.0); - - glPushMatrix(); - glTranslatef(-3.0, -2.0, 0.0); - glRotatef(angle, 0.0, 0.0, 1.0); - glCallList(gear1); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(3.1f, -2.f, 0.f); - glRotatef(-2.f * angle - 9.f, 0.f, 0.f, 1.f); - glCallList(gear2); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(-3.1f, 4.2f, 0.f); - glRotatef(-2.f * angle - 25.f, 0.f, 0.f, 1.f); - glCallList(gear3); - glPopMatrix(); - - glPopMatrix(); -} - - -/* update animation parameters */ -static void animate(void) -{ - angle = 100.f * (float) glfwGetTime(); -} - - -/* change view angle, exit upon ESC */ -void key( GLFWwindow* window, int k, int s, int action, int mods ) -{ - if( action != GLFW_PRESS ) return; - - switch (k) { - case GLFW_KEY_Z: - if( mods & GLFW_MOD_SHIFT ) - view_rotz -= 5.0; - else - view_rotz += 5.0; - break; - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - case GLFW_KEY_UP: - view_rotx += 5.0; - break; - case GLFW_KEY_DOWN: - view_rotx -= 5.0; - break; - case GLFW_KEY_LEFT: - view_roty += 5.0; - break; - case GLFW_KEY_RIGHT: - view_roty -= 5.0; - break; - default: - return; - } -} - - -/* new window size */ -void reshape( GLFWwindow* window, int width, int height ) -{ - GLfloat h = (GLfloat) height / (GLfloat) width; - GLfloat xmax, znear, zfar; - - znear = 5.0f; - zfar = 30.0f; - xmax = znear * 0.5f; - - glViewport( 0, 0, (GLint) width, (GLint) height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -xmax, xmax, -xmax*h, xmax*h, znear, zfar ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -20.0 ); -} - - -/* program & OpenGL initialization */ -static void init(int argc, char *argv[]) -{ - static GLfloat pos[4] = {5.f, 5.f, 10.f, 0.f}; - static GLfloat red[4] = {0.8f, 0.1f, 0.f, 1.f}; - static GLfloat green[4] = {0.f, 0.8f, 0.2f, 1.f}; - static GLfloat blue[4] = {0.2f, 0.2f, 1.f, 1.f}; - GLint i; - - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - /* make the gears */ - gear1 = glGenLists(1); - glNewList(gear1, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); - gear(1.f, 4.f, 1.f, 20, 0.7f); - glEndList(); - - gear2 = glGenLists(1); - glNewList(gear2, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); - gear(0.5f, 2.f, 2.f, 10, 0.7f); - glEndList(); - - gear3 = glGenLists(1); - glNewList(gear3, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); - gear(1.3f, 2.f, 0.5f, 10, 0.7f); - glEndList(); - - glEnable(GL_NORMALIZE); - - for ( i=1; i -#include -#include -#include -#include - -#include -#include - -/* Map height updates */ -#define MAX_CIRCLE_SIZE (5.0f) -#define MAX_DISPLACEMENT (1.0f) -#define DISPLACEMENT_SIGN_LIMIT (0.3f) -#define MAX_ITER (200) -#define NUM_ITER_AT_A_TIME (1) - -/* Map general information */ -#define MAP_SIZE (10.0f) -#define MAP_NUM_VERTICES (80) -#define MAP_NUM_TOTAL_VERTICES (MAP_NUM_VERTICES*MAP_NUM_VERTICES) -#define MAP_NUM_LINES (3* (MAP_NUM_VERTICES - 1) * (MAP_NUM_VERTICES - 1) + \ - 2 * (MAP_NUM_VERTICES - 1)) - - -/********************************************************************** - * Default shader programs - *********************************************************************/ - -static const char* vertex_shader_text = -"#version 150\n" -"uniform mat4 project;\n" -"uniform mat4 modelview;\n" -"in float x;\n" -"in float y;\n" -"in float z;\n" -"\n" -"void main()\n" -"{\n" -" gl_Position = project * modelview * vec4(x, y, z, 1.0);\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 150\n" -"out vec4 color;\n" -"void main()\n" -"{\n" -" color = vec4(0.2, 1.0, 0.2, 1.0); \n" -"}\n"; - -/********************************************************************** - * Values for shader uniforms - *********************************************************************/ - -/* Frustum configuration */ -static GLfloat view_angle = 45.0f; -static GLfloat aspect_ratio = 4.0f/3.0f; -static GLfloat z_near = 1.0f; -static GLfloat z_far = 100.f; - -/* Projection matrix */ -static GLfloat projection_matrix[16] = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f -}; - -/* Model view matrix */ -static GLfloat modelview_matrix[16] = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f -}; - -/********************************************************************** - * Heightmap vertex and index data - *********************************************************************/ - -static GLfloat map_vertices[3][MAP_NUM_TOTAL_VERTICES]; -static GLuint map_line_indices[2*MAP_NUM_LINES]; - -/* Store uniform location for the shaders - * Those values are setup as part of the process of creating - * the shader program. They should not be used before creating - * the program. - */ -static GLuint mesh; -static GLuint mesh_vbo[4]; - -/********************************************************************** - * OpenGL helper functions - *********************************************************************/ - -/* Creates a shader object of the specified type using the specified text - */ -static GLuint make_shader(GLenum type, const char* text) -{ - GLuint shader; - GLint shader_ok; - GLsizei log_length; - char info_log[8192]; - - shader = glCreateShader(type); - if (shader != 0) - { - glShaderSource(shader, 1, (const GLchar**)&text, NULL); - glCompileShader(shader); - glGetShaderiv(shader, GL_COMPILE_STATUS, &shader_ok); - if (shader_ok != GL_TRUE) - { - fprintf(stderr, "ERROR: Failed to compile %s shader\n", (type == GL_FRAGMENT_SHADER) ? "fragment" : "vertex" ); - glGetShaderInfoLog(shader, 8192, &log_length,info_log); - fprintf(stderr, "ERROR: \n%s\n\n", info_log); - glDeleteShader(shader); - shader = 0; - } - } - return shader; -} - -/* Creates a program object using the specified vertex and fragment text - */ -static GLuint make_shader_program(const char* vs_text, const char* fs_text) -{ - GLuint program = 0u; - GLint program_ok; - GLuint vertex_shader = 0u; - GLuint fragment_shader = 0u; - GLsizei log_length; - char info_log[8192]; - - vertex_shader = make_shader(GL_VERTEX_SHADER, vs_text); - if (vertex_shader != 0u) - { - fragment_shader = make_shader(GL_FRAGMENT_SHADER, fs_text); - if (fragment_shader != 0u) - { - /* make the program that connect the two shader and link it */ - program = glCreateProgram(); - if (program != 0u) - { - /* attach both shader and link */ - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - glGetProgramiv(program, GL_LINK_STATUS, &program_ok); - - if (program_ok != GL_TRUE) - { - fprintf(stderr, "ERROR, failed to link shader program\n"); - glGetProgramInfoLog(program, 8192, &log_length, info_log); - fprintf(stderr, "ERROR: \n%s\n\n", info_log); - glDeleteProgram(program); - glDeleteShader(fragment_shader); - glDeleteShader(vertex_shader); - program = 0u; - } - } - } - else - { - fprintf(stderr, "ERROR: Unable to load fragment shader\n"); - glDeleteShader(vertex_shader); - } - } - else - { - fprintf(stderr, "ERROR: Unable to load vertex shader\n"); - } - return program; -} - -/********************************************************************** - * Geometry creation functions - *********************************************************************/ - -/* Generate vertices and indices for the heightmap - */ -static void init_map(void) -{ - int i; - int j; - int k; - GLfloat step = MAP_SIZE / (MAP_NUM_VERTICES - 1); - GLfloat x = 0.0f; - GLfloat z = 0.0f; - /* Create a flat grid */ - k = 0; - for (i = 0 ; i < MAP_NUM_VERTICES ; ++i) - { - for (j = 0 ; j < MAP_NUM_VERTICES ; ++j) - { - map_vertices[0][k] = x; - map_vertices[1][k] = 0.0f; - map_vertices[2][k] = z; - z += step; - ++k; - } - x += step; - z = 0.0f; - } -#if DEBUG_ENABLED - for (i = 0 ; i < MAP_NUM_TOTAL_VERTICES ; ++i) - { - printf ("Vertice %d (%f, %f, %f)\n", - i, map_vertices[0][i], map_vertices[1][i], map_vertices[2][i]); - - } -#endif - /* create indices */ - /* line fan based on i - * i+1 - * | / i + n + 1 - * | / - * |/ - * i --- i + n - */ - - /* close the top of the square */ - k = 0; - for (i = 0 ; i < MAP_NUM_VERTICES -1 ; ++i) - { - map_line_indices[k++] = (i + 1) * MAP_NUM_VERTICES -1; - map_line_indices[k++] = (i + 2) * MAP_NUM_VERTICES -1; - } - /* close the right of the square */ - for (i = 0 ; i < MAP_NUM_VERTICES -1 ; ++i) - { - map_line_indices[k++] = (MAP_NUM_VERTICES - 1) * MAP_NUM_VERTICES + i; - map_line_indices[k++] = (MAP_NUM_VERTICES - 1) * MAP_NUM_VERTICES + i + 1; - } - - for (i = 0 ; i < (MAP_NUM_VERTICES - 1) ; ++i) - { - for (j = 0 ; j < (MAP_NUM_VERTICES - 1) ; ++j) - { - int ref = i * (MAP_NUM_VERTICES) + j; - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + 1; - - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + MAP_NUM_VERTICES; - - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + MAP_NUM_VERTICES + 1; - } - } - -#ifdef DEBUG_ENABLED - for (k = 0 ; k < 2 * MAP_NUM_LINES ; k += 2) - { - int beg, end; - beg = map_line_indices[k]; - end = map_line_indices[k+1]; - printf ("Line %d: %d -> %d (%f, %f, %f) -> (%f, %f, %f)\n", - k / 2, beg, end, - map_vertices[0][beg], map_vertices[1][beg], map_vertices[2][beg], - map_vertices[0][end], map_vertices[1][end], map_vertices[2][end]); - } -#endif -} - -static void generate_heightmap__circle(float* center_x, float* center_y, - float* size, float* displacement) -{ - float sign; - /* random value for element in between [0-1.0] */ - *center_x = (MAP_SIZE * rand()) / (1.0f * RAND_MAX); - *center_y = (MAP_SIZE * rand()) / (1.0f * RAND_MAX); - *size = (MAX_CIRCLE_SIZE * rand()) / (1.0f * RAND_MAX); - sign = (1.0f * rand()) / (1.0f * RAND_MAX); - sign = (sign < DISPLACEMENT_SIGN_LIMIT) ? -1.0f : 1.0f; - *displacement = (sign * (MAX_DISPLACEMENT * rand())) / (1.0f * RAND_MAX); -} - -/* Run the specified number of iterations of the generation process for the - * heightmap - */ -static void update_map(int num_iter) -{ - assert(num_iter > 0); - while(num_iter) - { - /* center of the circle */ - float center_x; - float center_z; - float circle_size; - float disp; - size_t ii; - generate_heightmap__circle(¢er_x, ¢er_z, &circle_size, &disp); - disp = disp / 2.0f; - for (ii = 0u ; ii < MAP_NUM_TOTAL_VERTICES ; ++ii) - { - GLfloat dx = center_x - map_vertices[0][ii]; - GLfloat dz = center_z - map_vertices[2][ii]; - GLfloat pd = (2.0f * sqrtf((dx * dx) + (dz * dz))) / circle_size; - if (fabs(pd) <= 1.0f) - { - /* tx,tz is within the circle */ - GLfloat new_height = disp + (float) (cos(pd*3.14f)*disp); - map_vertices[1][ii] += new_height; - } - } - --num_iter; - } -} - -/********************************************************************** - * OpenGL helper functions - *********************************************************************/ - -/* Create VBO, IBO and VAO objects for the heightmap geometry and bind them to - * the specified program object - */ -static void make_mesh(GLuint program) -{ - GLuint attrloc; - - glGenVertexArrays(1, &mesh); - glGenBuffers(4, mesh_vbo); - glBindVertexArray(mesh); - /* Prepare the data for drawing through a buffer inidices */ - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh_vbo[3]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)* MAP_NUM_LINES * 2, map_line_indices, GL_STATIC_DRAW); - - /* Prepare the attributes for rendering */ - attrloc = glGetAttribLocation(program, "x"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[0][0], GL_STATIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); - - attrloc = glGetAttribLocation(program, "z"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[2]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[2][0], GL_STATIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); - - attrloc = glGetAttribLocation(program, "y"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[1]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0], GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); -} - -/* Update VBO vertices from source data - */ -static void update_mesh(void) -{ - glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0]); -} - -/********************************************************************** - * GLFW callback functions - *********************************************************************/ - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - switch(key) - { - case GLFW_KEY_ESCAPE: - /* Exit program on Escape */ - glfwSetWindowShouldClose(window, GL_TRUE); - break; - } -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -int main(int argc, char** argv) -{ - GLFWwindow* window; - int iter; - double dt; - double last_update_time; - int frame; - float f; - GLint uloc_modelview; - GLint uloc_project; - - GLuint shader_program; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - - window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL); - if (! window ) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - /* Register events callback */ - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); - - /* Prepare opengl resources for rendering */ - shader_program = make_shader_program(vertex_shader_text, fragment_shader_text); - - if (shader_program == 0u) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glUseProgram(shader_program); - uloc_project = glGetUniformLocation(shader_program, "project"); - uloc_modelview = glGetUniformLocation(shader_program, "modelview"); - - /* Compute the projection matrix */ - f = 1.0f / tanf(view_angle / 2.0f); - projection_matrix[0] = f / aspect_ratio; - projection_matrix[5] = f; - projection_matrix[10] = (z_far + z_near)/ (z_near - z_far); - projection_matrix[11] = -1.0f; - projection_matrix[14] = 2.0f * (z_far * z_near) / (z_near - z_far); - glUniformMatrix4fv(uloc_project, 1, GL_FALSE, projection_matrix); - - /* Set the camera position */ - modelview_matrix[12] = -5.0f; - modelview_matrix[13] = -5.0f; - modelview_matrix[14] = -20.0f; - glUniformMatrix4fv(uloc_modelview, 1, GL_FALSE, modelview_matrix); - - /* Create mesh data */ - init_map(); - make_mesh(shader_program); - - /* Create vao + vbo to store the mesh */ - /* Create the vbo to store all the information for the grid and the height */ - - /* setup the scene ready for rendering */ - glViewport(0, 0, 800, 600); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - /* main loop */ - frame = 0; - iter = 0; - last_update_time = glfwGetTime(); - - while (!glfwWindowShouldClose(window)) - { - ++frame; - /* render the next frame */ - glClear(GL_COLOR_BUFFER_BIT); - glDrawElements(GL_LINES, 2* MAP_NUM_LINES , GL_UNSIGNED_INT, 0); - - /* display and process events through callbacks */ - glfwSwapBuffers(window); - glfwPollEvents(); - /* Check the frame rate and update the heightmap if needed */ - dt = glfwGetTime(); - if ((dt - last_update_time) > 0.2) - { - /* generate the next iteration of the heightmap */ - if (iter < MAX_ITER) - { - update_map(NUM_ITER_AT_A_TIME); - update_mesh(); - iter += NUM_ITER_AT_A_TIME; - } - last_update_time = dt; - frame = 0; - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/examples/particles.c b/testbed/nanogui/ext/glfw/examples/particles.c deleted file mode 100644 index dc9e9fc8..00000000 --- a/testbed/nanogui/ext/glfw/examples/particles.c +++ /dev/null @@ -1,1061 +0,0 @@ -//======================================================================== -// A simple particle engine with threaded physics -// Copyright (c) Marcus Geelnard -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#include -#include -#include -#include -#include - -#include -#include - -#define GLFW_INCLUDE_GLU -#include - -// Define tokens for GL_EXT_separate_specular_color if not already defined -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif // GL_EXT_separate_specular_color - -// Some 's do not define M_PI -#ifndef M_PI -#define M_PI 3.141592654 -#endif - - -//======================================================================== -// Type definitions -//======================================================================== - -typedef struct -{ - float x, y, z; -} Vec3; - -// This structure is used for interleaved vertex arrays (see the -// draw_particles function) -// -// NOTE: This structure SHOULD be packed on most systems. It uses 32-bit fields -// on 32-bit boundaries, and is a multiple of 64 bits in total (6x32=3x64). If -// it does not work, try using pragmas or whatever to force the structure to be -// packed. -typedef struct -{ - GLfloat s, t; // Texture coordinates - GLuint rgba; // Color (four ubytes packed into an uint) - GLfloat x, y, z; // Vertex coordinates -} Vertex; - - -//======================================================================== -// Program control global variables -//======================================================================== - -// Window dimensions -float aspect_ratio; - -// "wireframe" flag (true if we use wireframe view) -int wireframe; - -// Thread synchronization -struct { - double t; // Time (s) - float dt; // Time since last frame (s) - int p_frame; // Particle physics frame number - int d_frame; // Particle draw frame number - cnd_t p_done; // Condition: particle physics done - cnd_t d_done; // Condition: particle draw done - mtx_t particles_lock; // Particles data sharing mutex -} thread_sync; - - -//======================================================================== -// Texture declarations (we hard-code them into the source code, since -// they are so simple) -//======================================================================== - -#define P_TEX_WIDTH 8 // Particle texture dimensions -#define P_TEX_HEIGHT 8 -#define F_TEX_WIDTH 16 // Floor texture dimensions -#define F_TEX_HEIGHT 16 - -// Texture object IDs -GLuint particle_tex_id, floor_tex_id; - -// Particle texture (a simple spot) -const unsigned char particle_texture[ P_TEX_WIDTH * P_TEX_HEIGHT ] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x11, 0x22, 0x22, 0x11, 0x00, 0x00, - 0x00, 0x11, 0x33, 0x88, 0x77, 0x33, 0x11, 0x00, - 0x00, 0x22, 0x88, 0xff, 0xee, 0x77, 0x22, 0x00, - 0x00, 0x22, 0x77, 0xee, 0xff, 0x88, 0x22, 0x00, - 0x00, 0x11, 0x33, 0x77, 0x88, 0x33, 0x11, 0x00, - 0x00, 0x00, 0x11, 0x33, 0x22, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -// Floor texture (your basic checkered floor) -const unsigned char floor_texture[ F_TEX_WIDTH * F_TEX_HEIGHT ] = { - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xff, 0xf0, 0xcc, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xcc, 0xee, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0x66, 0x30, 0x30, 0x30, 0x20, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xee, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xcc, 0xf0, 0xf0, 0xf0, 0x30, 0x30, 0x55, 0x30, 0x30, 0x44, 0x30, 0x30, - 0xf0, 0xdd, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x60, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x33, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x30, 0x30, 0xf0, 0xff, 0xf0, 0xf0, 0xdd, 0xf0, 0xf0, 0xff, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x55, 0x33, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0, - 0x30, 0x44, 0x66, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xaa, 0xf0, 0xf0, 0xcc, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xdd, 0xf0, - 0x30, 0x30, 0x30, 0x77, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, -}; - - -//======================================================================== -// These are fixed constants that control the particle engine. In a -// modular world, these values should be variables... -//======================================================================== - -// Maximum number of particles -#define MAX_PARTICLES 3000 - -// Life span of a particle (in seconds) -#define LIFE_SPAN 8.f - -// A new particle is born every [BIRTH_INTERVAL] second -#define BIRTH_INTERVAL (LIFE_SPAN/(float)MAX_PARTICLES) - -// Particle size (meters) -#define PARTICLE_SIZE 0.7f - -// Gravitational constant (m/s^2) -#define GRAVITY 9.8f - -// Base initial velocity (m/s) -#define VELOCITY 8.f - -// Bounce friction (1.0 = no friction, 0.0 = maximum friction) -#define FRICTION 0.75f - -// "Fountain" height (m) -#define FOUNTAIN_HEIGHT 3.f - -// Fountain radius (m) -#define FOUNTAIN_RADIUS 1.6f - -// Minimum delta-time for particle phisics (s) -#define MIN_DELTA_T (BIRTH_INTERVAL * 0.5f) - - -//======================================================================== -// Particle system global variables -//======================================================================== - -// This structure holds all state for a single particle -typedef struct { - float x,y,z; // Position in space - float vx,vy,vz; // Velocity vector - float r,g,b; // Color of particle - float life; // Life of particle (1.0 = newborn, < 0.0 = dead) - int active; // Tells if this particle is active -} PARTICLE; - -// Global vectors holding all particles. We use two vectors for double -// buffering. -static PARTICLE particles[MAX_PARTICLES]; - -// Global variable holding the age of the youngest particle -static float min_age; - -// Color of latest born particle (used for fountain lighting) -static float glow_color[4]; - -// Position of latest born particle (used for fountain lighting) -static float glow_pos[4]; - - -//======================================================================== -// Object material and fog configuration constants -//======================================================================== - -const GLfloat fountain_diffuse[4] = { 0.7f, 1.f, 1.f, 1.f }; -const GLfloat fountain_specular[4] = { 1.f, 1.f, 1.f, 1.f }; -const GLfloat fountain_shininess = 12.f; -const GLfloat floor_diffuse[4] = { 1.f, 0.6f, 0.6f, 1.f }; -const GLfloat floor_specular[4] = { 0.6f, 0.6f, 0.6f, 1.f }; -const GLfloat floor_shininess = 18.f; -const GLfloat fog_color[4] = { 0.1f, 0.1f, 0.1f, 1.f }; - - -//======================================================================== -// Print usage information -//======================================================================== - -static void usage(void) -{ - printf("Usage: particles [-bfhs]\n"); - printf("Options:\n"); - printf(" -f Run in full screen\n"); - printf(" -h Display this help\n"); - printf(" -s Run program as single thread (default is to use two threads)\n"); - printf("\n"); - printf("Program runtime controls:\n"); - printf(" W Toggle wireframe mode\n"); - printf(" Esc Exit program\n"); -} - - -//======================================================================== -// Initialize a new particle -//======================================================================== - -static void init_particle(PARTICLE *p, double t) -{ - float xy_angle, velocity; - - // Start position of particle is at the fountain blow-out - p->x = 0.f; - p->y = 0.f; - p->z = FOUNTAIN_HEIGHT; - - // Start velocity is up (Z)... - p->vz = 0.7f + (0.3f / 4096.f) * (float) (rand() & 4095); - - // ...and a randomly chosen X/Y direction - xy_angle = (2.f * (float) M_PI / 4096.f) * (float) (rand() & 4095); - p->vx = 0.4f * (float) cos(xy_angle); - p->vy = 0.4f * (float) sin(xy_angle); - - // Scale velocity vector according to a time-varying velocity - velocity = VELOCITY * (0.8f + 0.1f * (float) (sin(0.5 * t) + sin(1.31 * t))); - p->vx *= velocity; - p->vy *= velocity; - p->vz *= velocity; - - // Color is time-varying - p->r = 0.7f + 0.3f * (float) sin(0.34 * t + 0.1); - p->g = 0.6f + 0.4f * (float) sin(0.63 * t + 1.1); - p->b = 0.6f + 0.4f * (float) sin(0.91 * t + 2.1); - - // Store settings for fountain glow lighting - glow_pos[0] = 0.4f * (float) sin(1.34 * t); - glow_pos[1] = 0.4f * (float) sin(3.11 * t); - glow_pos[2] = FOUNTAIN_HEIGHT + 1.f; - glow_pos[3] = 1.f; - glow_color[0] = p->r; - glow_color[1] = p->g; - glow_color[2] = p->b; - glow_color[3] = 1.f; - - // The particle is new-born and active - p->life = 1.f; - p->active = 1; -} - - -//======================================================================== -// Update a particle -//======================================================================== - -#define FOUNTAIN_R2 (FOUNTAIN_RADIUS+PARTICLE_SIZE/2)*(FOUNTAIN_RADIUS+PARTICLE_SIZE/2) - -static void update_particle(PARTICLE *p, float dt) -{ - // If the particle is not active, we need not do anything - if (!p->active) - return; - - // The particle is getting older... - p->life -= dt * (1.f / LIFE_SPAN); - - // Did the particle die? - if (p->life <= 0.f) - { - p->active = 0; - return; - } - - // Apply gravity - p->vz = p->vz - GRAVITY * dt; - - // Update particle position - p->x = p->x + p->vx * dt; - p->y = p->y + p->vy * dt; - p->z = p->z + p->vz * dt; - - // Simple collision detection + response - if (p->vz < 0.f) - { - // Particles should bounce on the fountain (with friction) - if ((p->x * p->x + p->y * p->y) < FOUNTAIN_R2 && - p->z < (FOUNTAIN_HEIGHT + PARTICLE_SIZE / 2)) - { - p->vz = -FRICTION * p->vz; - p->z = FOUNTAIN_HEIGHT + PARTICLE_SIZE / 2 + - FRICTION * (FOUNTAIN_HEIGHT + - PARTICLE_SIZE / 2 - p->z); - } - - // Particles should bounce on the floor (with friction) - else if (p->z < PARTICLE_SIZE / 2) - { - p->vz = -FRICTION * p->vz; - p->z = PARTICLE_SIZE / 2 + - FRICTION * (PARTICLE_SIZE / 2 - p->z); - } - } -} - - -//======================================================================== -// The main frame for the particle engine. Called once per frame. -//======================================================================== - -static void particle_engine(double t, float dt) -{ - int i; - float dt2; - - // Update particles (iterated several times per frame if dt is too large) - while (dt > 0.f) - { - // Calculate delta time for this iteration - dt2 = dt < MIN_DELTA_T ? dt : MIN_DELTA_T; - - for (i = 0; i < MAX_PARTICLES; i++) - update_particle(&particles[i], dt2); - - min_age += dt2; - - // Should we create any new particle(s)? - while (min_age >= BIRTH_INTERVAL) - { - min_age -= BIRTH_INTERVAL; - - // Find a dead particle to replace with a new one - for (i = 0; i < MAX_PARTICLES; i++) - { - if (!particles[i].active) - { - init_particle(&particles[i], t + min_age); - update_particle(&particles[i], min_age); - break; - } - } - } - - dt -= dt2; - } -} - - -//======================================================================== -// Draw all active particles. We use OpenGL 1.1 vertex -// arrays for this in order to accelerate the drawing. -//======================================================================== - -#define BATCH_PARTICLES 70 // Number of particles to draw in each batch - // (70 corresponds to 7.5 KB = will not blow - // the L1 data cache on most CPUs) -#define PARTICLE_VERTS 4 // Number of vertices per particle - -static void draw_particles(GLFWwindow* window, double t, float dt) -{ - int i, particle_count; - Vertex vertex_array[BATCH_PARTICLES * PARTICLE_VERTS]; - Vertex* vptr; - float alpha; - GLuint rgba; - Vec3 quad_lower_left, quad_lower_right; - GLfloat mat[16]; - PARTICLE* pptr; - - // Here comes the real trick with flat single primitive objects (s.c. - // "billboards"): We must rotate the textured primitive so that it - // always faces the viewer (is coplanar with the view-plane). - // We: - // 1) Create the primitive around origo (0,0,0) - // 2) Rotate it so that it is coplanar with the view plane - // 3) Translate it according to the particle position - // Note that 1) and 2) is the same for all particles (done only once). - - // Get modelview matrix. We will only use the upper left 3x3 part of - // the matrix, which represents the rotation. - glGetFloatv(GL_MODELVIEW_MATRIX, mat); - - // 1) & 2) We do it in one swift step: - // Although not obvious, the following six lines represent two matrix/ - // vector multiplications. The matrix is the inverse 3x3 rotation - // matrix (i.e. the transpose of the same matrix), and the two vectors - // represent the lower left corner of the quad, PARTICLE_SIZE/2 * - // (-1,-1,0), and the lower right corner, PARTICLE_SIZE/2 * (1,-1,0). - // The upper left/right corners of the quad is always the negative of - // the opposite corners (regardless of rotation). - quad_lower_left.x = (-PARTICLE_SIZE / 2) * (mat[0] + mat[1]); - quad_lower_left.y = (-PARTICLE_SIZE / 2) * (mat[4] + mat[5]); - quad_lower_left.z = (-PARTICLE_SIZE / 2) * (mat[8] + mat[9]); - quad_lower_right.x = (PARTICLE_SIZE / 2) * (mat[0] - mat[1]); - quad_lower_right.y = (PARTICLE_SIZE / 2) * (mat[4] - mat[5]); - quad_lower_right.z = (PARTICLE_SIZE / 2) * (mat[8] - mat[9]); - - // Don't update z-buffer, since all particles are transparent! - glDepthMask(GL_FALSE); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE); - - // Select particle texture - if (!wireframe) - { - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, particle_tex_id); - } - - // Set up vertex arrays. We use interleaved arrays, which is easier to - // handle (in most situations) and it gives a linear memeory access - // access pattern (which may give better performance in some - // situations). GL_T2F_C4UB_V3F means: 2 floats for texture coords, - // 4 ubytes for color and 3 floats for vertex coord (in that order). - // Most OpenGL cards / drivers are optimized for this format. - glInterleavedArrays(GL_T2F_C4UB_V3F, 0, vertex_array); - - // Wait for particle physics thread to be done - mtx_lock(&thread_sync.particles_lock); - while (!glfwWindowShouldClose(window) && - thread_sync.p_frame <= thread_sync.d_frame) - { - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - ts.tv_nsec += 100000000; - cnd_timedwait(&thread_sync.p_done, &thread_sync.particles_lock, &ts); - } - - // Store the frame time and delta time for the physics thread - thread_sync.t = t; - thread_sync.dt = dt; - - // Update frame counter - thread_sync.d_frame++; - - // Loop through all particles and build vertex arrays. - particle_count = 0; - vptr = vertex_array; - pptr = particles; - - for (i = 0; i < MAX_PARTICLES; i++) - { - if (pptr->active) - { - // Calculate particle intensity (we set it to max during 75% - // of its life, then it fades out) - alpha = 4.f * pptr->life; - if (alpha > 1.f) - alpha = 1.f; - - // Convert color from float to 8-bit (store it in a 32-bit - // integer using endian independent type casting) - ((GLubyte*) &rgba)[0] = (GLubyte)(pptr->r * 255.f); - ((GLubyte*) &rgba)[1] = (GLubyte)(pptr->g * 255.f); - ((GLubyte*) &rgba)[2] = (GLubyte)(pptr->b * 255.f); - ((GLubyte*) &rgba)[3] = (GLubyte)(alpha * 255.f); - - // 3) Translate the quad to the correct position in modelview - // space and store its parameters in vertex arrays (we also - // store texture coord and color information for each vertex). - - // Lower left corner - vptr->s = 0.f; - vptr->t = 0.f; - vptr->rgba = rgba; - vptr->x = pptr->x + quad_lower_left.x; - vptr->y = pptr->y + quad_lower_left.y; - vptr->z = pptr->z + quad_lower_left.z; - vptr ++; - - // Lower right corner - vptr->s = 1.f; - vptr->t = 0.f; - vptr->rgba = rgba; - vptr->x = pptr->x + quad_lower_right.x; - vptr->y = pptr->y + quad_lower_right.y; - vptr->z = pptr->z + quad_lower_right.z; - vptr ++; - - // Upper right corner - vptr->s = 1.f; - vptr->t = 1.f; - vptr->rgba = rgba; - vptr->x = pptr->x - quad_lower_left.x; - vptr->y = pptr->y - quad_lower_left.y; - vptr->z = pptr->z - quad_lower_left.z; - vptr ++; - - // Upper left corner - vptr->s = 0.f; - vptr->t = 1.f; - vptr->rgba = rgba; - vptr->x = pptr->x - quad_lower_right.x; - vptr->y = pptr->y - quad_lower_right.y; - vptr->z = pptr->z - quad_lower_right.z; - vptr ++; - - // Increase count of drawable particles - particle_count ++; - } - - // If we have filled up one batch of particles, draw it as a set - // of quads using glDrawArrays. - if (particle_count >= BATCH_PARTICLES) - { - // The first argument tells which primitive type we use (QUAD) - // The second argument tells the index of the first vertex (0) - // The last argument is the vertex count - glDrawArrays(GL_QUADS, 0, PARTICLE_VERTS * particle_count); - particle_count = 0; - vptr = vertex_array; - } - - // Next particle - pptr++; - } - - // We are done with the particle data - mtx_unlock(&thread_sync.particles_lock); - cnd_signal(&thread_sync.d_done); - - // Draw final batch of particles (if any) - glDrawArrays(GL_QUADS, 0, PARTICLE_VERTS * particle_count); - - // Disable vertex arrays (Note: glInterleavedArrays implicitly called - // glEnableClientState for vertex, texture coord and color arrays) - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - - glDisable(GL_TEXTURE_2D); - glDisable(GL_BLEND); - - glDepthMask(GL_TRUE); -} - - -//======================================================================== -// Fountain geometry specification -//======================================================================== - -#define FOUNTAIN_SIDE_POINTS 14 -#define FOUNTAIN_SWEEP_STEPS 32 - -static const float fountain_side[FOUNTAIN_SIDE_POINTS * 2] = -{ - 1.2f, 0.f, 1.f, 0.2f, 0.41f, 0.3f, 0.4f, 0.35f, - 0.4f, 1.95f, 0.41f, 2.f, 0.8f, 2.2f, 1.2f, 2.4f, - 1.5f, 2.7f, 1.55f,2.95f, 1.6f, 3.f, 1.f, 3.f, - 0.5f, 3.f, 0.f, 3.f -}; - -static const float fountain_normal[FOUNTAIN_SIDE_POINTS * 2] = -{ - 1.0000f, 0.0000f, 0.6428f, 0.7660f, 0.3420f, 0.9397f, 1.0000f, 0.0000f, - 1.0000f, 0.0000f, 0.3420f,-0.9397f, 0.4226f,-0.9063f, 0.5000f,-0.8660f, - 0.7660f,-0.6428f, 0.9063f,-0.4226f, 0.0000f,1.00000f, 0.0000f,1.00000f, - 0.0000f,1.00000f, 0.0000f,1.00000f -}; - - -//======================================================================== -// Draw a fountain -//======================================================================== - -static void draw_fountain(void) -{ - static GLuint fountain_list = 0; - double angle; - float x, y; - int m, n; - - // The first time, we build the fountain display list - if (!fountain_list) - { - fountain_list = glGenLists(1); - glNewList(fountain_list, GL_COMPILE_AND_EXECUTE); - - glMaterialfv(GL_FRONT, GL_DIFFUSE, fountain_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, fountain_specular); - glMaterialf(GL_FRONT, GL_SHININESS, fountain_shininess); - - // Build fountain using triangle strips - for (n = 0; n < FOUNTAIN_SIDE_POINTS - 1; n++) - { - glBegin(GL_TRIANGLE_STRIP); - for (m = 0; m <= FOUNTAIN_SWEEP_STEPS; m++) - { - angle = (double) m * (2.0 * M_PI / (double) FOUNTAIN_SWEEP_STEPS); - x = (float) cos(angle); - y = (float) sin(angle); - - // Draw triangle strip - glNormal3f(x * fountain_normal[n * 2 + 2], - y * fountain_normal[n * 2 + 2], - fountain_normal[n * 2 + 3]); - glVertex3f(x * fountain_side[n * 2 + 2], - y * fountain_side[n * 2 + 2], - fountain_side[n * 2 +3 ]); - glNormal3f(x * fountain_normal[n * 2], - y * fountain_normal[n * 2], - fountain_normal[n * 2 + 1]); - glVertex3f(x * fountain_side[n * 2], - y * fountain_side[n * 2], - fountain_side[n * 2 + 1]); - } - - glEnd(); - } - - glEndList(); - } - else - glCallList(fountain_list); -} - - -//======================================================================== -// Recursive function for building variable tesselated floor -//======================================================================== - -static void tessellate_floor(float x1, float y1, float x2, float y2, int depth) -{ - float delta, x, y; - - // Last recursion? - if (depth >= 5) - delta = 999999.f; - else - { - x = (float) (fabs(x1) < fabs(x2) ? fabs(x1) : fabs(x2)); - y = (float) (fabs(y1) < fabs(y2) ? fabs(y1) : fabs(y2)); - delta = x*x + y*y; - } - - // Recurse further? - if (delta < 0.1f) - { - x = (x1 + x2) * 0.5f; - y = (y1 + y2) * 0.5f; - tessellate_floor(x1, y1, x, y, depth + 1); - tessellate_floor(x, y1, x2, y, depth + 1); - tessellate_floor(x1, y, x, y2, depth + 1); - tessellate_floor(x, y, x2, y2, depth + 1); - } - else - { - glTexCoord2f(x1 * 30.f, y1 * 30.f); - glVertex3f( x1 * 80.f, y1 * 80.f, 0.f); - glTexCoord2f(x2 * 30.f, y1 * 30.f); - glVertex3f( x2 * 80.f, y1 * 80.f, 0.f); - glTexCoord2f(x2 * 30.f, y2 * 30.f); - glVertex3f( x2 * 80.f, y2 * 80.f, 0.f); - glTexCoord2f(x1 * 30.f, y2 * 30.f); - glVertex3f( x1 * 80.f, y2 * 80.f, 0.f); - } -} - - -//======================================================================== -// Draw floor. We build the floor recursively and let the tessellation in the -// center (near x,y=0,0) be high, while the tessellation around the edges be -// low. -//======================================================================== - -static void draw_floor(void) -{ - static GLuint floor_list = 0; - - if (!wireframe) - { - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, floor_tex_id); - } - - // The first time, we build the floor display list - if (!floor_list) - { - floor_list = glGenLists(1); - glNewList(floor_list, GL_COMPILE_AND_EXECUTE); - - glMaterialfv(GL_FRONT, GL_DIFFUSE, floor_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, floor_specular); - glMaterialf(GL_FRONT, GL_SHININESS, floor_shininess); - - // Draw floor as a bunch of triangle strips (high tesselation - // improves lighting) - glNormal3f(0.f, 0.f, 1.f); - glBegin(GL_QUADS); - tessellate_floor(-1.f, -1.f, 0.f, 0.f, 0); - tessellate_floor( 0.f, -1.f, 1.f, 0.f, 0); - tessellate_floor( 0.f, 0.f, 1.f, 1.f, 0); - tessellate_floor(-1.f, 0.f, 0.f, 1.f, 0); - glEnd(); - - glEndList(); - } - else - glCallList(floor_list); - - glDisable(GL_TEXTURE_2D); - -} - - -//======================================================================== -// Position and configure light sources -//======================================================================== - -static void setup_lights(void) -{ - float l1pos[4], l1amb[4], l1dif[4], l1spec[4]; - float l2pos[4], l2amb[4], l2dif[4], l2spec[4]; - - // Set light source 1 parameters - l1pos[0] = 0.f; l1pos[1] = -9.f; l1pos[2] = 8.f; l1pos[3] = 1.f; - l1amb[0] = 0.2f; l1amb[1] = 0.2f; l1amb[2] = 0.2f; l1amb[3] = 1.f; - l1dif[0] = 0.8f; l1dif[1] = 0.4f; l1dif[2] = 0.2f; l1dif[3] = 1.f; - l1spec[0] = 1.f; l1spec[1] = 0.6f; l1spec[2] = 0.2f; l1spec[3] = 0.f; - - // Set light source 2 parameters - l2pos[0] = -15.f; l2pos[1] = 12.f; l2pos[2] = 1.5f; l2pos[3] = 1.f; - l2amb[0] = 0.f; l2amb[1] = 0.f; l2amb[2] = 0.f; l2amb[3] = 1.f; - l2dif[0] = 0.2f; l2dif[1] = 0.4f; l2dif[2] = 0.8f; l2dif[3] = 1.f; - l2spec[0] = 0.2f; l2spec[1] = 0.6f; l2spec[2] = 1.f; l2spec[3] = 0.f; - - glLightfv(GL_LIGHT1, GL_POSITION, l1pos); - glLightfv(GL_LIGHT1, GL_AMBIENT, l1amb); - glLightfv(GL_LIGHT1, GL_DIFFUSE, l1dif); - glLightfv(GL_LIGHT1, GL_SPECULAR, l1spec); - glLightfv(GL_LIGHT2, GL_POSITION, l2pos); - glLightfv(GL_LIGHT2, GL_AMBIENT, l2amb); - glLightfv(GL_LIGHT2, GL_DIFFUSE, l2dif); - glLightfv(GL_LIGHT2, GL_SPECULAR, l2spec); - glLightfv(GL_LIGHT3, GL_POSITION, glow_pos); - glLightfv(GL_LIGHT3, GL_DIFFUSE, glow_color); - glLightfv(GL_LIGHT3, GL_SPECULAR, glow_color); - - glEnable(GL_LIGHT1); - glEnable(GL_LIGHT2); - glEnable(GL_LIGHT3); -} - - -//======================================================================== -// Main rendering function -//======================================================================== - -static void draw_scene(GLFWwindow* window, double t) -{ - double xpos, ypos, zpos, angle_x, angle_y, angle_z; - static double t_old = 0.0; - float dt; - - // Calculate frame-to-frame delta time - dt = (float) (t - t_old); - t_old = t; - - glClearColor(0.1f, 0.1f, 0.1f, 1.f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(65.0, aspect_ratio, 1.0, 60.0); - - // Setup camera - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - // Rotate camera - angle_x = 90.0 - 10.0; - angle_y = 10.0 * sin(0.3 * t); - angle_z = 10.0 * t; - glRotated(-angle_x, 1.0, 0.0, 0.0); - glRotated(-angle_y, 0.0, 1.0, 0.0); - glRotated(-angle_z, 0.0, 0.0, 1.0); - - // Translate camera - xpos = 15.0 * sin((M_PI / 180.0) * angle_z) + - 2.0 * sin((M_PI / 180.0) * 3.1 * t); - ypos = -15.0 * cos((M_PI / 180.0) * angle_z) + - 2.0 * cos((M_PI / 180.0) * 2.9 * t); - zpos = 4.0 + 2.0 * cos((M_PI / 180.0) * 4.9 * t); - glTranslated(-xpos, -ypos, -zpos); - - glFrontFace(GL_CCW); - glCullFace(GL_BACK); - glEnable(GL_CULL_FACE); - - setup_lights(); - glEnable(GL_LIGHTING); - - glEnable(GL_FOG); - glFogi(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 0.05f); - glFogfv(GL_FOG_COLOR, fog_color); - - draw_floor(); - - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - glDepthMask(GL_TRUE); - - draw_fountain(); - - glDisable(GL_LIGHTING); - glDisable(GL_FOG); - - // Particles must be drawn after all solid objects have been drawn - draw_particles(window, t, dt); - - // Z-buffer not needed anymore - glDisable(GL_DEPTH_TEST); -} - - -//======================================================================== -// Window resize callback function -//======================================================================== - -static void resize_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); - aspect_ratio = height ? width / (float) height : 1.f; -} - - -//======================================================================== -// Key callback functions -//======================================================================== - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action == GLFW_PRESS) - { - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - case GLFW_KEY_W: - wireframe = !wireframe; - glPolygonMode(GL_FRONT_AND_BACK, - wireframe ? GL_LINE : GL_FILL); - break; - default: - break; - } - } -} - - -//======================================================================== -// Thread for updating particle physics -//======================================================================== - -static int physics_thread_main(void* arg) -{ - GLFWwindow* window = arg; - - for (;;) - { - mtx_lock(&thread_sync.particles_lock); - - // Wait for particle drawing to be done - while (!glfwWindowShouldClose(window) && - thread_sync.p_frame > thread_sync.d_frame) - { - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - ts.tv_nsec += 100000000; - cnd_timedwait(&thread_sync.d_done, &thread_sync.particles_lock, &ts); - } - - if (glfwWindowShouldClose(window)) - break; - - // Update particles - particle_engine(thread_sync.t, thread_sync.dt); - - // Update frame counter - thread_sync.p_frame++; - - // Unlock mutex and signal drawing thread - mtx_unlock(&thread_sync.particles_lock); - cnd_signal(&thread_sync.p_done); - } - - return 0; -} - - -//======================================================================== -// main -//======================================================================== - -int main(int argc, char** argv) -{ - int ch, width, height; - thrd_t physics_thread = 0; - GLFWwindow* window; - GLFWmonitor* monitor = NULL; - - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - while ((ch = getopt(argc, argv, "fh")) != -1) - { - switch (ch) - { - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - case 'h': - usage(); - exit(EXIT_SUCCESS); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - window = glfwCreateWindow(width, height, "Particle Engine", monitor, NULL); - if (!window) - { - fprintf(stderr, "Failed to create GLFW window\n"); - glfwTerminate(); - exit(EXIT_FAILURE); - } - - if (monitor) - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetWindowSizeCallback(window, resize_callback); - glfwSetKeyCallback(window, key_callback); - - // Set initial aspect ratio - glfwGetWindowSize(window, &width, &height); - resize_callback(window, width, height); - - // Upload particle texture - glGenTextures(1, &particle_tex_id); - glBindTexture(GL_TEXTURE_2D, particle_tex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, P_TEX_WIDTH, P_TEX_HEIGHT, - 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, particle_texture); - - // Upload floor texture - glGenTextures(1, &floor_tex_id); - glBindTexture(GL_TEXTURE_2D, floor_tex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, F_TEX_WIDTH, F_TEX_HEIGHT, - 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, floor_texture); - - if (glfwExtensionSupported("GL_EXT_separate_specular_color")) - { - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL_EXT, - GL_SEPARATE_SPECULAR_COLOR_EXT); - } - - // Set filled polygon mode as default (not wireframe) - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - wireframe = 0; - - // Set initial times - thread_sync.t = 0.0; - thread_sync.dt = 0.001f; - thread_sync.p_frame = 0; - thread_sync.d_frame = 0; - - mtx_init(&thread_sync.particles_lock, mtx_timed); - cnd_init(&thread_sync.p_done); - cnd_init(&thread_sync.d_done); - - if (thrd_create(&physics_thread, physics_thread_main, window) != thrd_success) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetTime(0.0); - - while (!glfwWindowShouldClose(window)) - { - draw_scene(window, glfwGetTime()); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - thrd_join(physics_thread, NULL); - - glfwDestroyWindow(window); - glfwTerminate(); - - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/examples/simple.c b/testbed/nanogui/ext/glfw/examples/simple.c deleted file mode 100644 index c39be574..00000000 --- a/testbed/nanogui/ext/glfw/examples/simple.c +++ /dev/null @@ -1,102 +0,0 @@ -//======================================================================== -// Simple GLFW example -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -//! [code] - -#include - -#include -#include - -static void error_callback(int error, const char* description) -{ - fputs(description, stderr); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -int main(void) -{ - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetKeyCallback(window, key_callback); - - while (!glfwWindowShouldClose(window)) - { - float ratio; - int width, height; - - glfwGetFramebufferSize(window, &width, &height); - ratio = width / (float) height; - - glViewport(0, 0, width, height); - glClear(GL_COLOR_BUFFER_BIT); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f); - glMatrixMode(GL_MODELVIEW); - - glLoadIdentity(); - glRotatef((float) glfwGetTime() * 50.f, 0.f, 0.f, 1.f); - - glBegin(GL_TRIANGLES); - glColor3f(1.f, 0.f, 0.f); - glVertex3f(-0.6f, -0.4f, 0.f); - glColor3f(0.f, 1.f, 0.f); - glVertex3f(0.6f, -0.4f, 0.f); - glColor3f(0.f, 0.f, 1.f); - glVertex3f(0.f, 0.6f, 0.f); - glEnd(); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - -//! [code] diff --git a/testbed/nanogui/ext/glfw/examples/splitview.c b/testbed/nanogui/ext/glfw/examples/splitview.c deleted file mode 100644 index 1ffcda67..00000000 --- a/testbed/nanogui/ext/glfw/examples/splitview.c +++ /dev/null @@ -1,505 +0,0 @@ -//======================================================================== -// This is an example program for the GLFW library -// -// The program uses a "split window" view, rendering four views of the -// same scene in one window (e.g. uesful for 3D modelling software). This -// demo uses scissors to separete the four different rendering areas from -// each other. -// -// (If the code seems a little bit strange here and there, it may be -// because I am not a friend of orthogonal projections) -//======================================================================== - -#define GLFW_INCLUDE_GLU -#include - -#include -#include -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - - -//======================================================================== -// Global variables -//======================================================================== - -// Mouse position -static double xpos = 0, ypos = 0; - -// Window size -static int width, height; - -// Active view: 0 = none, 1 = upper left, 2 = upper right, 3 = lower left, -// 4 = lower right -static int active_view = 0; - -// Rotation around each axis -static int rot_x = 0, rot_y = 0, rot_z = 0; - -// Do redraw? -static int do_redraw = 1; - - -//======================================================================== -// Draw a solid torus (use a display list for the model) -//======================================================================== - -#define TORUS_MAJOR 1.5 -#define TORUS_MINOR 0.5 -#define TORUS_MAJOR_RES 32 -#define TORUS_MINOR_RES 32 - -static void drawTorus(void) -{ - static GLuint torus_list = 0; - int i, j, k; - double s, t, x, y, z, nx, ny, nz, scale, twopi; - - if (!torus_list) - { - // Start recording displaylist - torus_list = glGenLists(1); - glNewList(torus_list, GL_COMPILE_AND_EXECUTE); - - // Draw torus - twopi = 2.0 * M_PI; - for (i = 0; i < TORUS_MINOR_RES; i++) - { - glBegin(GL_QUAD_STRIP); - for (j = 0; j <= TORUS_MAJOR_RES; j++) - { - for (k = 1; k >= 0; k--) - { - s = (i + k) % TORUS_MINOR_RES + 0.5; - t = j % TORUS_MAJOR_RES; - - // Calculate point on surface - x = (TORUS_MAJOR + TORUS_MINOR * cos(s * twopi / TORUS_MINOR_RES)) * cos(t * twopi / TORUS_MAJOR_RES); - y = TORUS_MINOR * sin(s * twopi / TORUS_MINOR_RES); - z = (TORUS_MAJOR + TORUS_MINOR * cos(s * twopi / TORUS_MINOR_RES)) * sin(t * twopi / TORUS_MAJOR_RES); - - // Calculate surface normal - nx = x - TORUS_MAJOR * cos(t * twopi / TORUS_MAJOR_RES); - ny = y; - nz = z - TORUS_MAJOR * sin(t * twopi / TORUS_MAJOR_RES); - scale = 1.0 / sqrt(nx*nx + ny*ny + nz*nz); - nx *= scale; - ny *= scale; - nz *= scale; - - glNormal3f((float) nx, (float) ny, (float) nz); - glVertex3f((float) x, (float) y, (float) z); - } - } - - glEnd(); - } - - // Stop recording displaylist - glEndList(); - } - else - { - // Playback displaylist - glCallList(torus_list); - } -} - - -//======================================================================== -// Draw the scene (a rotating torus) -//======================================================================== - -static void drawScene(void) -{ - const GLfloat model_diffuse[4] = {1.0f, 0.8f, 0.8f, 1.0f}; - const GLfloat model_specular[4] = {0.6f, 0.6f, 0.6f, 1.0f}; - const GLfloat model_shininess = 20.0f; - - glPushMatrix(); - - // Rotate the object - glRotatef((GLfloat) rot_x * 0.5f, 1.0f, 0.0f, 0.0f); - glRotatef((GLfloat) rot_y * 0.5f, 0.0f, 1.0f, 0.0f); - glRotatef((GLfloat) rot_z * 0.5f, 0.0f, 0.0f, 1.0f); - - // Set model color (used for orthogonal views, lighting disabled) - glColor4fv(model_diffuse); - - // Set model material (used for perspective view, lighting enabled) - glMaterialfv(GL_FRONT, GL_DIFFUSE, model_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, model_specular); - glMaterialf(GL_FRONT, GL_SHININESS, model_shininess); - - // Draw torus - drawTorus(); - - glPopMatrix(); -} - - -//======================================================================== -// Draw a 2D grid (used for orthogonal views) -//======================================================================== - -static void drawGrid(float scale, int steps) -{ - int i; - float x, y; - - glPushMatrix(); - - // Set background to some dark bluish grey - glClearColor(0.05f, 0.05f, 0.2f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - // Setup modelview matrix (flat XY view) - glLoadIdentity(); - gluLookAt(0.0, 0.0, 1.0, - 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0); - - // We don't want to update the Z-buffer - glDepthMask(GL_FALSE); - - // Set grid color - glColor3f(0.0f, 0.5f, 0.5f); - - glBegin(GL_LINES); - - // Horizontal lines - x = scale * 0.5f * (float) (steps - 1); - y = -scale * 0.5f * (float) (steps - 1); - for (i = 0; i < steps; i++) - { - glVertex3f(-x, y, 0.0f); - glVertex3f(x, y, 0.0f); - y += scale; - } - - // Vertical lines - x = -scale * 0.5f * (float) (steps - 1); - y = scale * 0.5f * (float) (steps - 1); - for (i = 0; i < steps; i++) - { - glVertex3f(x, -y, 0.0f); - glVertex3f(x, y, 0.0f); - x += scale; - } - - glEnd(); - - // Enable Z-buffer writing again - glDepthMask(GL_TRUE); - - glPopMatrix(); -} - - -//======================================================================== -// Draw all views -//======================================================================== - -static void drawAllViews(void) -{ - const GLfloat light_position[4] = {0.0f, 8.0f, 8.0f, 1.0f}; - const GLfloat light_diffuse[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - const GLfloat light_specular[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - const GLfloat light_ambient[4] = {0.2f, 0.2f, 0.3f, 1.0f}; - double aspect; - - // Calculate aspect of window - if (height > 0) - aspect = (double) width / (double) height; - else - aspect = 1.0; - - // Clear screen - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // Enable scissor test - glEnable(GL_SCISSOR_TEST); - - // Enable depth test - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - - // ** ORTHOGONAL VIEWS ** - - // For orthogonal views, use wireframe rendering - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - // Enable line anti-aliasing - glEnable(GL_LINE_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - // Setup orthogonal projection matrix - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-3.0 * aspect, 3.0 * aspect, -3.0, 3.0, 1.0, 50.0); - - // Upper left view (TOP VIEW) - glViewport(0, height / 2, width / 2, height / 2); - glScissor(0, height / 2, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(0.0f, 10.0f, 1e-3f, // Eye-position (above) - 0.0f, 0.0f, 0.0f, // View-point - 0.0f, 1.0f, 0.0f); // Up-vector - drawGrid(0.5, 12); - drawScene(); - - // Lower left view (FRONT VIEW) - glViewport(0, 0, width / 2, height / 2); - glScissor(0, 0, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(0.0f, 0.0f, 10.0f, // Eye-position (in front of) - 0.0f, 0.0f, 0.0f, // View-point - 0.0f, 1.0f, 0.0f); // Up-vector - drawGrid(0.5, 12); - drawScene(); - - // Lower right view (SIDE VIEW) - glViewport(width / 2, 0, width / 2, height / 2); - glScissor(width / 2, 0, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(10.0f, 0.0f, 0.0f, // Eye-position (to the right) - 0.0f, 0.0f, 0.0f, // View-point - 0.0f, 1.0f, 0.0f); // Up-vector - drawGrid(0.5, 12); - drawScene(); - - // Disable line anti-aliasing - glDisable(GL_LINE_SMOOTH); - glDisable(GL_BLEND); - - // ** PERSPECTIVE VIEW ** - - // For perspective view, use solid rendering - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - // Enable face culling (faster rendering) - glEnable(GL_CULL_FACE); - glCullFace(GL_BACK); - glFrontFace(GL_CW); - - // Setup perspective projection matrix - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(65.0f, aspect, 1.0f, 50.0f); - - // Upper right view (PERSPECTIVE VIEW) - glViewport(width / 2, height / 2, width / 2, height / 2); - glScissor(width / 2, height / 2, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(3.0f, 1.5f, 3.0f, // Eye-position - 0.0f, 0.0f, 0.0f, // View-point - 0.0f, 1.0f, 0.0f); // Up-vector - - // Configure and enable light source 1 - glLightfv(GL_LIGHT1, GL_POSITION, light_position); - glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); - glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); - glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); - glEnable(GL_LIGHT1); - glEnable(GL_LIGHTING); - - // Draw scene - drawScene(); - - // Disable lighting - glDisable(GL_LIGHTING); - - // Disable face culling - glDisable(GL_CULL_FACE); - - // Disable depth test - glDisable(GL_DEPTH_TEST); - - // Disable scissor test - glDisable(GL_SCISSOR_TEST); - - // Draw a border around the active view - if (active_view > 0 && active_view != 2) - { - glViewport(0, 0, width, height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0, 2.0, 0.0, 2.0, 0.0, 1.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef((GLfloat) ((active_view - 1) & 1), (GLfloat) (1 - (active_view - 1) / 2), 0.0f); - - glColor3f(1.0f, 1.0f, 0.6f); - - glBegin(GL_LINE_STRIP); - glVertex2i(0, 0); - glVertex2i(1, 0); - glVertex2i(1, 1); - glVertex2i(0, 1); - glVertex2i(0, 0); - glEnd(); - } -} - - -//======================================================================== -// Framebuffer size callback function -//======================================================================== - -static void framebufferSizeFun(GLFWwindow* window, int w, int h) -{ - width = w; - height = h > 0 ? h : 1; - do_redraw = 1; -} - - -//======================================================================== -// Window refresh callback function -//======================================================================== - -static void windowRefreshFun(GLFWwindow* window) -{ - drawAllViews(); - glfwSwapBuffers(window); - do_redraw = 0; -} - - -//======================================================================== -// Mouse position callback function -//======================================================================== - -static void cursorPosFun(GLFWwindow* window, double x, double y) -{ - // Depending on which view was selected, rotate around different axes - switch (active_view) - { - case 1: - rot_x += (int) (y - ypos); - rot_z += (int) (x - xpos); - do_redraw = 1; - break; - case 3: - rot_x += (int) (y - ypos); - rot_y += (int) (x - xpos); - do_redraw = 1; - break; - case 4: - rot_y += (int) (x - xpos); - rot_z += (int) (y - ypos); - do_redraw = 1; - break; - default: - // Do nothing for perspective view, or if no view is selected - break; - } - - // Remember cursor position - xpos = x; - ypos = y; -} - - -//======================================================================== -// Mouse button callback function -//======================================================================== - -static void mouseButtonFun(GLFWwindow* window, int button, int action, int mods) -{ - if ((button == GLFW_MOUSE_BUTTON_LEFT) && action == GLFW_PRESS) - { - // Detect which of the four views was clicked - active_view = 1; - if (xpos >= width / 2) - active_view += 1; - if (ypos >= height / 2) - active_view += 2; - } - else if (button == GLFW_MOUSE_BUTTON_LEFT) - { - // Deselect any previously selected view - active_view = 0; - } - - do_redraw = 1; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} - - -//======================================================================== -// main -//======================================================================== - -int main(void) -{ - GLFWwindow* window; - - // Initialise GLFW - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - // Open OpenGL window - window = glfwCreateWindow(500, 500, "Split view demo", NULL, NULL); - if (!window) - { - fprintf(stderr, "Failed to open GLFW window\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - // Set callback functions - glfwSetFramebufferSizeCallback(window, framebufferSizeFun); - glfwSetWindowRefreshCallback(window, windowRefreshFun); - glfwSetCursorPosCallback(window, cursorPosFun); - glfwSetMouseButtonCallback(window, mouseButtonFun); - glfwSetKeyCallback(window, key_callback); - - // Enable vsync - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwGetFramebufferSize(window, &width, &height); - framebufferSizeFun(window, width, height); - - // Main loop - for (;;) - { - // Only redraw if we need to - if (do_redraw) - windowRefreshFun(window); - - // Wait for new events - glfwWaitEvents(); - - // Check if the window should be closed - if (glfwWindowShouldClose(window)) - break; - } - - // Close OpenGL window and terminate GLFW - glfwTerminate(); - - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/examples/wave.c b/testbed/nanogui/ext/glfw/examples/wave.c deleted file mode 100644 index bafe4652..00000000 --- a/testbed/nanogui/ext/glfw/examples/wave.c +++ /dev/null @@ -1,452 +0,0 @@ -/***************************************************************************** - * Wave Simulation in OpenGL - * (C) 2002 Jakob Thomsen - * http://home.in.tum.de/~thomsen - * Modified for GLFW by Sylvain Hellegouarch - sh@programmationworld.com - * Modified for variable frame rate by Marcus Geelnard - * 2003-Jan-31: Minor cleanups and speedups / MG - * 2010-10-24: Formatting and cleanup - Camilla Berglund - *****************************************************************************/ - -#include -#include -#include - -#define GLFW_INCLUDE_GLU -#include - -#ifndef M_PI - #define M_PI 3.1415926535897932384626433832795 -#endif - -// Maximum delta T to allow for differential calculations -#define MAX_DELTA_T 0.01 - -// Animation speed (10.0 looks good) -#define ANIMATION_SPEED 10.0 - -GLfloat alpha = 210.f, beta = -70.f; -GLfloat zoom = 2.f; - -double cursorX; -double cursorY; - -struct Vertex -{ - GLfloat x, y, z; - GLfloat r, g, b; -}; - -#define GRIDW 50 -#define GRIDH 50 -#define VERTEXNUM (GRIDW*GRIDH) - -#define QUADW (GRIDW - 1) -#define QUADH (GRIDH - 1) -#define QUADNUM (QUADW*QUADH) - -GLuint quad[4 * QUADNUM]; -struct Vertex vertex[VERTEXNUM]; - -/* The grid will look like this: - * - * 3 4 5 - * *---*---* - * | | | - * | 0 | 1 | - * | | | - * *---*---* - * 0 1 2 - */ - -//======================================================================== -// Initialize grid geometry -//======================================================================== - -void init_vertices(void) -{ - int x, y, p; - - // Place the vertices in a grid - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - p = y * GRIDW + x; - - vertex[p].x = (GLfloat) (x - GRIDW / 2) / (GLfloat) (GRIDW / 2); - vertex[p].y = (GLfloat) (y - GRIDH / 2) / (GLfloat) (GRIDH / 2); - vertex[p].z = 0; - - if ((x % 4 < 2) ^ (y % 4 < 2)) - vertex[p].r = 0.0; - else - vertex[p].r = 1.0; - - vertex[p].g = (GLfloat) y / (GLfloat) GRIDH; - vertex[p].b = 1.f - ((GLfloat) x / (GLfloat) GRIDW + (GLfloat) y / (GLfloat) GRIDH) / 2.f; - } - } - - for (y = 0; y < QUADH; y++) - { - for (x = 0; x < QUADW; x++) - { - p = 4 * (y * QUADW + x); - - quad[p + 0] = y * GRIDW + x; // Some point - quad[p + 1] = y * GRIDW + x + 1; // Neighbor at the right side - quad[p + 2] = (y + 1) * GRIDW + x + 1; // Upper right neighbor - quad[p + 3] = (y + 1) * GRIDW + x; // Upper neighbor - } - } -} - -double dt; -double p[GRIDW][GRIDH]; -double vx[GRIDW][GRIDH], vy[GRIDW][GRIDH]; -double ax[GRIDW][GRIDH], ay[GRIDW][GRIDH]; - -//======================================================================== -// Initialize grid -//======================================================================== - -void init_grid(void) -{ - int x, y; - double dx, dy, d; - - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - dx = (double) (x - GRIDW / 2); - dy = (double) (y - GRIDH / 2); - d = sqrt(dx * dx + dy * dy); - if (d < 0.1 * (double) (GRIDW / 2)) - { - d = d * 10.0; - p[x][y] = -cos(d * (M_PI / (double)(GRIDW * 4))) * 100.0; - } - else - p[x][y] = 0.0; - - vx[x][y] = 0.0; - vy[x][y] = 0.0; - } - } -} - - -//======================================================================== -// Draw scene -//======================================================================== - -void draw_scene(GLFWwindow* window) -{ - // Clear the color and depth buffers - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // We don't want to modify the projection matrix - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - // Move back - glTranslatef(0.0, 0.0, -zoom); - // Rotate the view - glRotatef(beta, 1.0, 0.0, 0.0); - glRotatef(alpha, 0.0, 0.0, 1.0); - - glDrawElements(GL_QUADS, 4 * QUADNUM, GL_UNSIGNED_INT, quad); - - glfwSwapBuffers(window); -} - - -//======================================================================== -// Initialize Miscellaneous OpenGL state -//======================================================================== - -void init_opengl(void) -{ - // Use Gouraud (smooth) shading - glShadeModel(GL_SMOOTH); - - // Switch on the z-buffer - glEnable(GL_DEPTH_TEST); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - glVertexPointer(3, GL_FLOAT, sizeof(struct Vertex), vertex); - glColorPointer(3, GL_FLOAT, sizeof(struct Vertex), &vertex[0].r); // Pointer to the first color - - glPointSize(2.0); - - // Background color is black - glClearColor(0, 0, 0, 0); -} - - -//======================================================================== -// Modify the height of each vertex according to the pressure -//======================================================================== - -void adjust_grid(void) -{ - int pos; - int x, y; - - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - pos = y * GRIDW + x; - vertex[pos].z = (float) (p[x][y] * (1.0 / 50.0)); - } - } -} - - -//======================================================================== -// Calculate wave propagation -//======================================================================== - -void calc_grid(void) -{ - int x, y, x2, y2; - double time_step = dt * ANIMATION_SPEED; - - // Compute accelerations - for (x = 0; x < GRIDW; x++) - { - x2 = (x + 1) % GRIDW; - for(y = 0; y < GRIDH; y++) - ax[x][y] = p[x][y] - p[x2][y]; - } - - for (y = 0; y < GRIDH; y++) - { - y2 = (y + 1) % GRIDH; - for(x = 0; x < GRIDW; x++) - ay[x][y] = p[x][y] - p[x][y2]; - } - - // Compute speeds - for (x = 0; x < GRIDW; x++) - { - for (y = 0; y < GRIDH; y++) - { - vx[x][y] = vx[x][y] + ax[x][y] * time_step; - vy[x][y] = vy[x][y] + ay[x][y] * time_step; - } - } - - // Compute pressure - for (x = 1; x < GRIDW; x++) - { - x2 = x - 1; - for (y = 1; y < GRIDH; y++) - { - y2 = y - 1; - p[x][y] = p[x][y] + (vx[x2][y] - vx[x][y] + vy[x][y2] - vy[x][y]) * time_step; - } - } -} - - -//======================================================================== -// Print errors -//======================================================================== - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - - -//======================================================================== -// Handle key strokes -//======================================================================== - -void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - case GLFW_KEY_SPACE: - init_grid(); - break; - case GLFW_KEY_LEFT: - alpha += 5; - break; - case GLFW_KEY_RIGHT: - alpha -= 5; - break; - case GLFW_KEY_UP: - beta -= 5; - break; - case GLFW_KEY_DOWN: - beta += 5; - break; - case GLFW_KEY_PAGE_UP: - zoom -= 0.25f; - if (zoom < 0.f) - zoom = 0.f; - break; - case GLFW_KEY_PAGE_DOWN: - zoom += 0.25f; - break; - default: - break; - } -} - - -//======================================================================== -// Callback function for mouse button events -//======================================================================== - -void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - if (button != GLFW_MOUSE_BUTTON_LEFT) - return; - - if (action == GLFW_PRESS) - { - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - glfwGetCursorPos(window, &cursorX, &cursorY); - } - else - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); -} - - -//======================================================================== -// Callback function for cursor motion events -//======================================================================== - -void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - if (glfwGetInputMode(window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED) - { - alpha += (GLfloat) (x - cursorX) / 10.f; - beta += (GLfloat) (y - cursorY) / 10.f; - - cursorX = x; - cursorY = y; - } -} - - -//======================================================================== -// Callback function for scroll events -//======================================================================== - -void scroll_callback(GLFWwindow* window, double x, double y) -{ - zoom += (float) y / 4.f; - if (zoom < 0) - zoom = 0; -} - - -//======================================================================== -// Callback function for framebuffer resize events -//======================================================================== - -void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - float ratio = 1.f; - - if (height > 0) - ratio = (float) width / (float) height; - - // Setup viewport - glViewport(0, 0, width, height); - - // Change to the projection matrix and set our viewing volume - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60.0, ratio, 1.0, 1024.0); -} - - -//======================================================================== -// main -//======================================================================== - -int main(int argc, char* argv[]) -{ - GLFWwindow* window; - double t, dt_total, t_old; - int width, height; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Wave Simulation", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetMouseButtonCallback(window, mouse_button_callback); - glfwSetCursorPosCallback(window, cursor_position_callback); - glfwSetScrollCallback(window, scroll_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwGetFramebufferSize(window, &width, &height); - framebuffer_size_callback(window, width, height); - - // Initialize OpenGL - init_opengl(); - - // Initialize simulation - init_vertices(); - init_grid(); - adjust_grid(); - - // Initialize timer - t_old = glfwGetTime() - 0.01; - - while (!glfwWindowShouldClose(window)) - { - t = glfwGetTime(); - dt_total = t - t_old; - t_old = t; - - // Safety - iterate if dt_total is too large - while (dt_total > 0.f) - { - // Select iteration time step - dt = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total; - dt_total -= dt; - - // Calculate wave propagation - calc_grid(); - } - - // Compute height of each vertex - adjust_grid(); - - // Draw wave grid to OpenGL display - draw_scene(window); - - glfwPollEvents(); - } - - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/CMakeLists.txt b/testbed/nanogui/ext/glfw/tests/CMakeLists.txt deleted file mode 100644 index 5386f588..00000000 --- a/testbed/nanogui/ext/glfw/tests/CMakeLists.txt +++ /dev/null @@ -1,82 +0,0 @@ - -link_libraries(glfw) - -if (BUILD_SHARED_LIBS) - add_definitions(-DGLFW_DLL) - link_libraries("${OPENGL_gl_LIBRARY}" "${MATH_LIBRARY}") -else() - link_libraries(${glfw_LIBRARIES}) -endif() - -include_directories("${GLFW_SOURCE_DIR}/include" - "${GLFW_SOURCE_DIR}/deps") - -if ("${OPENGL_INCLUDE_DIR}") - include_directories("${OPENGL_INCLUDE_DIR}") -endif() - -set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" - "${GLFW_SOURCE_DIR}/deps/getopt.c") -set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" - "${GLFW_SOURCE_DIR}/deps/tinycthread.c") - -add_executable(clipboard clipboard.c ${GETOPT}) -add_executable(defaults defaults.c) -add_executable(events events.c ${GETOPT}) -add_executable(fsaa fsaa.c ${GETOPT}) -add_executable(gamma gamma.c ${GETOPT}) -add_executable(glfwinfo glfwinfo.c ${GETOPT}) -add_executable(iconify iconify.c ${GETOPT}) -add_executable(joysticks joysticks.c) -add_executable(monitors monitors.c ${GETOPT}) -add_executable(peter peter.c) -add_executable(reopen reopen.c) -add_executable(cursor cursor.c) - -add_executable(cursoranim WIN32 MACOSX_BUNDLE cursoranim.c) -set_target_properties(cursoranim PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Cursor animation") - -add_executable(accuracy WIN32 MACOSX_BUNDLE accuracy.c) -set_target_properties(accuracy PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Accuracy") - -add_executable(empty WIN32 MACOSX_BUNDLE empty.c ${TINYCTHREAD}) -set_target_properties(empty PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Empty Event") - -add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c) -set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing") - -add_executable(tearing WIN32 MACOSX_BUNDLE tearing.c) -set_target_properties(tearing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Tearing") - -add_executable(threads WIN32 MACOSX_BUNDLE threads.c ${TINYCTHREAD}) -set_target_properties(threads PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Threads") - -add_executable(title WIN32 MACOSX_BUNDLE title.c) -set_target_properties(title PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Title") - -add_executable(windows WIN32 MACOSX_BUNDLE windows.c) -set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows") - -target_link_libraries(empty "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") -target_link_libraries(threads "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") - -set(WINDOWS_BINARIES accuracy empty sharing tearing threads title windows cursoranim) -set(CONSOLE_BINARIES clipboard defaults events fsaa gamma glfwinfo - iconify joysticks monitors peter reopen cursor) - -set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES - FOLDER "GLFW3/Tests") - -if (MSVC) - # Tell MSVC to use main instead of WinMain for Windows subsystem executables - set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES - LINK_FLAGS "/ENTRY:mainCRTStartup") -endif() - -if (APPLE) - set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES - MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL} - MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/AppleInfo.plist") -endif() - diff --git a/testbed/nanogui/ext/glfw/tests/accuracy.c b/testbed/nanogui/ext/glfw/tests/accuracy.c deleted file mode 100644 index 6a63c889..00000000 --- a/testbed/nanogui/ext/glfw/tests/accuracy.c +++ /dev/null @@ -1,128 +0,0 @@ -//======================================================================== -// Mouse cursor accuracy test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test came about as the result of bug #1867804 -// -// No sign of said bug has so far been detected -// -//======================================================================== - -#include - -#include -#include - -static double cursor_x = 0.0, cursor_y = 0.0; -static int window_width = 640, window_height = 480; -static int swap_interval = 1; - -static void set_swap_interval(GLFWwindow* window, int interval) -{ - char title[256]; - - swap_interval = interval; - glfwSwapInterval(swap_interval); - - sprintf(title, "Cursor Inaccuracy Detector (interval %i)", swap_interval); - - glfwSetWindowTitle(window, title); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - window_width = width; - window_height = height; - - glViewport(0, 0, window_width, window_height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.f, window_width, 0.f, window_height, 0.f, 1.f); -} - -static void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - cursor_x = x; - cursor_y = y; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) - set_swap_interval(window, 1 - swap_interval); -} - -int main(void) -{ - GLFWwindow* window; - int width, height; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(window_width, window_height, "", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetCursorPosCallback(window, cursor_position_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - - glfwGetFramebufferSize(window, &width, &height); - framebuffer_size_callback(window, width, height); - - set_swap_interval(window, swap_interval); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINES); - glVertex2f(0.f, (GLfloat) (window_height - cursor_y)); - glVertex2f((GLfloat) window_width, (GLfloat) (window_height - cursor_y)); - glVertex2f((GLfloat) cursor_x, 0.f); - glVertex2f((GLfloat) cursor_x, (GLfloat) window_height); - glEnd(); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/clipboard.c b/testbed/nanogui/ext/glfw/tests/clipboard.c deleted file mode 100644 index 43422845..00000000 --- a/testbed/nanogui/ext/glfw/tests/clipboard.c +++ /dev/null @@ -1,149 +0,0 @@ -//======================================================================== -// Clipboard test program -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This program is used to test the clipboard functionality. -// -//======================================================================== - -#include - -#include -#include - -#include "getopt.h" - -static void usage(void) -{ - printf("Usage: clipboard [-h]\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - - case GLFW_KEY_V: - if (mods == GLFW_MOD_CONTROL) - { - const char* string; - - string = glfwGetClipboardString(window); - if (string) - printf("Clipboard contains \"%s\"\n", string); - else - printf("Clipboard does not contain a string\n"); - } - break; - - case GLFW_KEY_C: - if (mods == GLFW_MOD_CONTROL) - { - const char* string = "Hello GLFW World!"; - glfwSetClipboardString(window, string); - printf("Setting clipboard to \"%s\"\n", string); - } - break; - } -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -int main(int argc, char** argv) -{ - int ch; - GLFWwindow* window; - - while ((ch = getopt(argc, argv, "h")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - window = glfwCreateWindow(200, 200, "Clipboard Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - - fprintf(stderr, "Failed to open GLFW window\n"); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - glMatrixMode(GL_PROJECTION); - glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); - glMatrixMode(GL_MODELVIEW); - - glClearColor(0.5f, 0.5f, 0.5f, 0); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glColor3f(0.8f, 0.2f, 0.4f); - glRectf(-0.5f, -0.5f, 0.5f, 0.5f); - - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/cursor.c b/testbed/nanogui/ext/glfw/tests/cursor.c deleted file mode 100644 index fc65c4da..00000000 --- a/testbed/nanogui/ext/glfw/tests/cursor.c +++ /dev/null @@ -1,288 +0,0 @@ -//======================================================================== -// Cursor & input mode tests -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// System cursors and input modes tests. -// -//======================================================================== - -#include - -#include -#include - -static int W = 640; -static int H = 480; -static int delay = 0; - -static GLFWwindow* windows[2] = { NULL, NULL }; -static GLFWwindow* activeWindow = NULL; -static GLFWcursor* cursor = NULL; - -static struct -{ - int key; - double time; -} commands[] = { - {GLFW_KEY_H, 0}, - {GLFW_KEY_C, 0}, - {GLFW_KEY_D, 0}, - {GLFW_KEY_S, 0}, - {GLFW_KEY_N, 0}, - {GLFW_KEY_1, 0}, - {GLFW_KEY_2, 0}, - {GLFW_KEY_3, 0} -}; - -static int CommandCount = sizeof(commands) / sizeof(commands[0]); - -static struct -{ - int w, h; -} cursorSize[] = { - { 24, 24 }, { 13, 37 }, { 5, 53 }, { 43, 64 }, { 300, 300 } -}; - -static int SizeCount = sizeof(cursorSize) / sizeof(cursorSize[0]); -static int currentSize = 0; - -static void command_callback(int key) -{ - switch (key) - { - case GLFW_KEY_H: - { - printf("H: show this help\n"); - printf("C: call glfwCreateCursor()\n"); - printf("D: call glfwDestroyCursor()\n"); - printf("S: call glfwSetCursor()\n"); - printf("N: call glfwSetCursor() with NULL\n"); - printf("1: set GLFW_CURSOR_NORMAL\n"); - printf("2: set GLFW_CURSOR_HIDDEN\n"); - printf("3: set GLFW_CURSOR_DISABLED\n"); - printf("T: enable 3s delay for all previous commands\n"); - } - break; - - case GLFW_KEY_C: - { - int x, y; - GLFWimage image; - unsigned char* pixels; - - if (cursor) - break; - - image.width = cursorSize[currentSize].w; - image.height = cursorSize[currentSize].h; - - pixels = malloc(4 * image.width * image.height); - image.pixels = pixels; - - for (y = 0; y < image.height; y++) - { - for (x = 0; x < image.width; x++) - { - *pixels++ = 0xff; - *pixels++ = 0; - *pixels++ = 255 * y / image.height; - *pixels++ = 255 * x / image.width; - } - } - - cursor = glfwCreateCursor(&image, image.width / 2, image.height / 2); - currentSize = (currentSize + 1) % SizeCount; - free(image.pixels); - break; - } - - case GLFW_KEY_D: - { - if (cursor != NULL) - { - glfwDestroyCursor(cursor); - cursor = NULL; - } - - break; - } - - case GLFW_KEY_S: - { - if (cursor != NULL) - glfwSetCursor(activeWindow, cursor); - else - printf("The cursor is not created\n"); - - break; - } - - case GLFW_KEY_N: - glfwSetCursor(activeWindow, NULL); - break; - - case GLFW_KEY_1: - glfwSetInputMode(activeWindow, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - break; - - case GLFW_KEY_2: - glfwSetInputMode(activeWindow, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - break; - - case GLFW_KEY_3: - glfwSetInputMode(activeWindow, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - break; - } -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - W = width; - H = height; - - glViewport(0, 0, W, H); -} - -static void refresh_callback(GLFWwindow* window) -{ - glfwMakeContextCurrent(window); - glClearColor(0.0f, window == activeWindow ? 0.8f : 0.0f, 0.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - - case GLFW_KEY_T: - delay = !delay; - printf("Delay %s.\n", delay ? "enabled" : "disabled"); - break; - - default: - { - if (delay) - { - int i = 0; - - while (i < CommandCount && commands[i].key != key) - i++; - - if (i < CommandCount) - commands[i].time = glfwGetTime(); - } - else - { - command_callback(key); - } - } - break; - } -} - -static void focus_callback(GLFWwindow* window, int focused) -{ - if (focused) - { - activeWindow = window; - refresh_callback(windows[0]); - refresh_callback(windows[1]); - } -} - -int main(void) -{ - int i; - GLboolean running = GL_TRUE; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - for (i = 0; i < 2; i++) - { - windows[i] = glfwCreateWindow(W, H, "Cursor testing", NULL, NULL); - - if (!windows[i]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetWindowPos(windows[i], 100 + (i & 1) * (W + 50), 100); - - glfwSetWindowRefreshCallback(windows[i], refresh_callback); - glfwSetFramebufferSizeCallback(windows[i], framebuffer_size_callback); - glfwSetKeyCallback(windows[i], key_callback); - glfwSetWindowFocusCallback(windows[i], focus_callback); - - glfwMakeContextCurrent(windows[i]); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(windows[i]); - } - - activeWindow = windows[0]; - - key_callback(NULL, GLFW_KEY_H, 0, GLFW_PRESS, 0); - - while (running) - { - if (delay) - { - int i; - double t = glfwGetTime(); - - for (i = 0; i < CommandCount; i++) - { - if (commands[i].time != 0 && t - commands[i].time >= 3.0) - { - command_callback(commands[i].key); - commands[i].time = 0; - } - } - } - - running = !(glfwWindowShouldClose(windows[0]) || glfwWindowShouldClose(windows[1])); - - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/cursoranim.c b/testbed/nanogui/ext/glfw/tests/cursoranim.c deleted file mode 100644 index 39a229c8..00000000 --- a/testbed/nanogui/ext/glfw/tests/cursoranim.c +++ /dev/null @@ -1,135 +0,0 @@ -//======================================================================== -// Cursor animation -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// Cursor animation test. -// -//======================================================================== - -#include - -#include -#include - -#ifdef min - #undef min -#endif -#ifdef max - #undef max -#endif - -#define SIZE 64 // cursor size (width & height) -#define N 60 // number of frames - -unsigned char buffer[4 * SIZE * SIZE]; - -static float max(float a, float b) { return a > b ? a : b; } -static float min(float a, float b) { return a < b ? a : b; } - -static float star(int x, int y, float t) -{ - float c = SIZE / 2.0f; - - float i = (0.25f * (float)sin(2.0f * 3.1415926f * t) + 0.75f); - float k = SIZE * 0.046875f * i; - - float dist = (float)sqrt((x - c) * (x - c) + (y - c) * (y - c)); - - float salpha = 1.0f - dist / c; - float xalpha = (float)x == c ? c : k / (float)fabs(x - c); - float yalpha = (float)y == c ? c : k / (float)fabs(y - c); - - return max(0.0f, min(1.0f, i * salpha * 0.2f + salpha * xalpha * yalpha)); -} - -static GLFWcursor* load_frame(float t) -{ - int i = 0, x, y; - const GLFWimage image = { SIZE, SIZE, buffer }; - - for (y = 0; y < image.width; y++) - { - for (x = 0; x < image.height; x++) - { - buffer[i++] = 255; - buffer[i++] = 255; - buffer[i++] = 255; - buffer[i++] = (unsigned char)(255 * star(x, y, t)); - } - } - - return glfwCreateCursor(&image, image.width / 2, image.height / 2); -} - -int main(void) -{ - int i; - double t0, t1, frameTime = 0.0; - - GLFWwindow* window; - GLFWcursor* frames[N]; - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Cursor animation", NULL, NULL); - - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - for (i = 0; i < N; i++) - frames[i] = load_frame(i / (float)N); - - i = 0; - - t0 = glfwGetTime(); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSetCursor(window, frames[i]); - glfwSwapBuffers(window); - glfwPollEvents(); - - t1 = glfwGetTime(); - frameTime += t1 - t0; - t0 = t1; - - while (frameTime > 1.0 / (double)N) - { - i = (i + 1) % N; - frameTime -= 1.0 / (double)N; - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/defaults.c b/testbed/nanogui/ext/glfw/tests/defaults.c deleted file mode 100644 index 07ba5a45..00000000 --- a/testbed/nanogui/ext/glfw/tests/defaults.c +++ /dev/null @@ -1,131 +0,0 @@ -//======================================================================== -// Default window/context test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test creates a windowed mode window with all window hints set to -// default values and then reports the actual attributes of the created -// window and context -// -//======================================================================== - -#define GLFW_INCLUDE_GLEXT -#include - -#include -#include - -typedef struct -{ - int attrib; - const char* ext; - const char* name; -} AttribGL; - -typedef struct -{ - int attrib; - const char* name; -} AttribGLFW; - -static AttribGL gl_attribs[] = -{ - { GL_RED_BITS, NULL, "red bits" }, - { GL_GREEN_BITS, NULL, "green bits" }, - { GL_BLUE_BITS, NULL, "blue bits" }, - { GL_ALPHA_BITS, NULL, "alpha bits" }, - { GL_DEPTH_BITS, NULL, "depth bits" }, - { GL_STENCIL_BITS, NULL, "stencil bits" }, - { GL_STEREO, NULL, "stereo" }, - { GL_SAMPLES_ARB, "GL_ARB_multisample", "FSAA samples" }, - { 0, NULL, NULL } -}; - -static AttribGLFW glfw_attribs[] = -{ - { GLFW_CONTEXT_VERSION_MAJOR, "Context version major" }, - { GLFW_CONTEXT_VERSION_MINOR, "Context version minor" }, - { GLFW_OPENGL_FORWARD_COMPAT, "OpenGL forward compatible" }, - { GLFW_OPENGL_DEBUG_CONTEXT, "OpenGL debug context" }, - { GLFW_OPENGL_PROFILE, "OpenGL profile" }, - { 0, NULL } -}; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -int main(void) -{ - int i, width, height; - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - window = glfwCreateWindow(640, 480, "Defaults", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwGetFramebufferSize(window, &width, &height); - - printf("framebuffer size: %ix%i\n", width, height); - - for (i = 0; glfw_attribs[i].name; i++) - { - printf("%s: %i\n", - glfw_attribs[i].name, - glfwGetWindowAttrib(window, glfw_attribs[i].attrib)); - } - - for (i = 0; gl_attribs[i].name; i++) - { - GLint value = 0; - - if (gl_attribs[i].ext) - { - if (!glfwExtensionSupported(gl_attribs[i].ext)) - continue; - } - - glGetIntegerv(gl_attribs[i].attrib, &value); - - printf("%s: %i\n", gl_attribs[i].name, value); - } - - glfwDestroyWindow(window); - window = NULL; - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/empty.c b/testbed/nanogui/ext/glfw/tests/empty.c deleted file mode 100644 index a4534ae5..00000000 --- a/testbed/nanogui/ext/glfw/tests/empty.c +++ /dev/null @@ -1,129 +0,0 @@ -//======================================================================== -// Empty event test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test is intended to verify that posting of empty events works -// -//======================================================================== - -#include "tinycthread.h" - -#include - -#include -#include -#include - -static volatile GLboolean running = GL_TRUE; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static int thread_main(void* data) -{ - struct timespec time; - - while (running) - { - clock_gettime(CLOCK_REALTIME, &time); - time.tv_sec += 1; - thrd_sleep(&time, NULL); - - glfwPostEmptyEvent(); - } - - return 0; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -static float nrand(void) -{ - return (float) rand() / (float) RAND_MAX; -} - -int main(void) -{ - int result; - thrd_t thread; - GLFWwindow* window; - - srand((unsigned int) time(NULL)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Empty Event Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSetKeyCallback(window, key_callback); - - if (thrd_create(&thread, thread_main, NULL) != thrd_success) - { - fprintf(stderr, "Failed to create secondary thread\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - while (running) - { - int width, height; - float r = nrand(), g = nrand(), b = nrand(); - float l = (float) sqrt(r * r + g * g + b * b); - - glfwGetFramebufferSize(window, &width, &height); - - glViewport(0, 0, width, height); - glClearColor(r / l, g / l, b / l, 1.f); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - - glfwWaitEvents(); - - if (glfwWindowShouldClose(window)) - running = GL_FALSE; - } - - glfwHideWindow(window); - thrd_join(thread, &result); - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/events.c b/testbed/nanogui/ext/glfw/tests/events.c deleted file mode 100644 index f40576d4..00000000 --- a/testbed/nanogui/ext/glfw/tests/events.c +++ /dev/null @@ -1,581 +0,0 @@ -//======================================================================== -// Event linter (event spewer) -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test hooks every available callback and outputs their arguments -// -// Log messages go to stdout, error messages to stderr -// -// Every event also gets a (sequential) number to aid discussion of logs -// -//======================================================================== - -#include - -#include -#include -#include -#include -#include - -#include "getopt.h" - -// Event index -static unsigned int counter = 0; - -typedef struct -{ - GLFWwindow* window; - int number; - int closeable; -} Slot; - -static void usage(void) -{ - printf("Usage: events [-f] [-h] [-n WINDOWS]\n"); - printf("Options:\n"); - printf(" -f use full screen\n"); - printf(" -h show this help\n"); - printf(" -n the number of windows to create\n"); -} - -static const char* get_key_name(int key) -{ - switch (key) - { - // Printable keys - case GLFW_KEY_A: return "A"; - case GLFW_KEY_B: return "B"; - case GLFW_KEY_C: return "C"; - case GLFW_KEY_D: return "D"; - case GLFW_KEY_E: return "E"; - case GLFW_KEY_F: return "F"; - case GLFW_KEY_G: return "G"; - case GLFW_KEY_H: return "H"; - case GLFW_KEY_I: return "I"; - case GLFW_KEY_J: return "J"; - case GLFW_KEY_K: return "K"; - case GLFW_KEY_L: return "L"; - case GLFW_KEY_M: return "M"; - case GLFW_KEY_N: return "N"; - case GLFW_KEY_O: return "O"; - case GLFW_KEY_P: return "P"; - case GLFW_KEY_Q: return "Q"; - case GLFW_KEY_R: return "R"; - case GLFW_KEY_S: return "S"; - case GLFW_KEY_T: return "T"; - case GLFW_KEY_U: return "U"; - case GLFW_KEY_V: return "V"; - case GLFW_KEY_W: return "W"; - case GLFW_KEY_X: return "X"; - case GLFW_KEY_Y: return "Y"; - case GLFW_KEY_Z: return "Z"; - case GLFW_KEY_1: return "1"; - case GLFW_KEY_2: return "2"; - case GLFW_KEY_3: return "3"; - case GLFW_KEY_4: return "4"; - case GLFW_KEY_5: return "5"; - case GLFW_KEY_6: return "6"; - case GLFW_KEY_7: return "7"; - case GLFW_KEY_8: return "8"; - case GLFW_KEY_9: return "9"; - case GLFW_KEY_0: return "0"; - case GLFW_KEY_SPACE: return "SPACE"; - case GLFW_KEY_MINUS: return "MINUS"; - case GLFW_KEY_EQUAL: return "EQUAL"; - case GLFW_KEY_LEFT_BRACKET: return "LEFT BRACKET"; - case GLFW_KEY_RIGHT_BRACKET: return "RIGHT BRACKET"; - case GLFW_KEY_BACKSLASH: return "BACKSLASH"; - case GLFW_KEY_SEMICOLON: return "SEMICOLON"; - case GLFW_KEY_APOSTROPHE: return "APOSTROPHE"; - case GLFW_KEY_GRAVE_ACCENT: return "GRAVE ACCENT"; - case GLFW_KEY_COMMA: return "COMMA"; - case GLFW_KEY_PERIOD: return "PERIOD"; - case GLFW_KEY_SLASH: return "SLASH"; - case GLFW_KEY_WORLD_1: return "WORLD 1"; - case GLFW_KEY_WORLD_2: return "WORLD 2"; - - // Function keys - case GLFW_KEY_ESCAPE: return "ESCAPE"; - case GLFW_KEY_F1: return "F1"; - case GLFW_KEY_F2: return "F2"; - case GLFW_KEY_F3: return "F3"; - case GLFW_KEY_F4: return "F4"; - case GLFW_KEY_F5: return "F5"; - case GLFW_KEY_F6: return "F6"; - case GLFW_KEY_F7: return "F7"; - case GLFW_KEY_F8: return "F8"; - case GLFW_KEY_F9: return "F9"; - case GLFW_KEY_F10: return "F10"; - case GLFW_KEY_F11: return "F11"; - case GLFW_KEY_F12: return "F12"; - case GLFW_KEY_F13: return "F13"; - case GLFW_KEY_F14: return "F14"; - case GLFW_KEY_F15: return "F15"; - case GLFW_KEY_F16: return "F16"; - case GLFW_KEY_F17: return "F17"; - case GLFW_KEY_F18: return "F18"; - case GLFW_KEY_F19: return "F19"; - case GLFW_KEY_F20: return "F20"; - case GLFW_KEY_F21: return "F21"; - case GLFW_KEY_F22: return "F22"; - case GLFW_KEY_F23: return "F23"; - case GLFW_KEY_F24: return "F24"; - case GLFW_KEY_F25: return "F25"; - case GLFW_KEY_UP: return "UP"; - case GLFW_KEY_DOWN: return "DOWN"; - case GLFW_KEY_LEFT: return "LEFT"; - case GLFW_KEY_RIGHT: return "RIGHT"; - case GLFW_KEY_LEFT_SHIFT: return "LEFT SHIFT"; - case GLFW_KEY_RIGHT_SHIFT: return "RIGHT SHIFT"; - case GLFW_KEY_LEFT_CONTROL: return "LEFT CONTROL"; - case GLFW_KEY_RIGHT_CONTROL: return "RIGHT CONTROL"; - case GLFW_KEY_LEFT_ALT: return "LEFT ALT"; - case GLFW_KEY_RIGHT_ALT: return "RIGHT ALT"; - case GLFW_KEY_TAB: return "TAB"; - case GLFW_KEY_ENTER: return "ENTER"; - case GLFW_KEY_BACKSPACE: return "BACKSPACE"; - case GLFW_KEY_INSERT: return "INSERT"; - case GLFW_KEY_DELETE: return "DELETE"; - case GLFW_KEY_PAGE_UP: return "PAGE UP"; - case GLFW_KEY_PAGE_DOWN: return "PAGE DOWN"; - case GLFW_KEY_HOME: return "HOME"; - case GLFW_KEY_END: return "END"; - case GLFW_KEY_KP_0: return "KEYPAD 0"; - case GLFW_KEY_KP_1: return "KEYPAD 1"; - case GLFW_KEY_KP_2: return "KEYPAD 2"; - case GLFW_KEY_KP_3: return "KEYPAD 3"; - case GLFW_KEY_KP_4: return "KEYPAD 4"; - case GLFW_KEY_KP_5: return "KEYPAD 5"; - case GLFW_KEY_KP_6: return "KEYPAD 6"; - case GLFW_KEY_KP_7: return "KEYPAD 7"; - case GLFW_KEY_KP_8: return "KEYPAD 8"; - case GLFW_KEY_KP_9: return "KEYPAD 9"; - case GLFW_KEY_KP_DIVIDE: return "KEYPAD DIVIDE"; - case GLFW_KEY_KP_MULTIPLY: return "KEYPAD MULTPLY"; - case GLFW_KEY_KP_SUBTRACT: return "KEYPAD SUBTRACT"; - case GLFW_KEY_KP_ADD: return "KEYPAD ADD"; - case GLFW_KEY_KP_DECIMAL: return "KEYPAD DECIMAL"; - case GLFW_KEY_KP_EQUAL: return "KEYPAD EQUAL"; - case GLFW_KEY_KP_ENTER: return "KEYPAD ENTER"; - case GLFW_KEY_PRINT_SCREEN: return "PRINT SCREEN"; - case GLFW_KEY_NUM_LOCK: return "NUM LOCK"; - case GLFW_KEY_CAPS_LOCK: return "CAPS LOCK"; - case GLFW_KEY_SCROLL_LOCK: return "SCROLL LOCK"; - case GLFW_KEY_PAUSE: return "PAUSE"; - case GLFW_KEY_LEFT_SUPER: return "LEFT SUPER"; - case GLFW_KEY_RIGHT_SUPER: return "RIGHT SUPER"; - case GLFW_KEY_MENU: return "MENU"; - - default: return "UNKNOWN"; - } -} - -static const char* get_action_name(int action) -{ - switch (action) - { - case GLFW_PRESS: - return "pressed"; - case GLFW_RELEASE: - return "released"; - case GLFW_REPEAT: - return "repeated"; - } - - return "caused unknown action"; -} - -static const char* get_button_name(int button) -{ - switch (button) - { - case GLFW_MOUSE_BUTTON_LEFT: - return "left"; - case GLFW_MOUSE_BUTTON_RIGHT: - return "right"; - case GLFW_MOUSE_BUTTON_MIDDLE: - return "middle"; - default: - { - static char name[16]; - sprintf(name, "%i", button); - return name; - } - } -} - -static const char* get_mods_name(int mods) -{ - static char name[512]; - - if (mods == 0) - return " no mods"; - - name[0] = '\0'; - - if (mods & GLFW_MOD_SHIFT) - strcat(name, " shift"); - if (mods & GLFW_MOD_CONTROL) - strcat(name, " control"); - if (mods & GLFW_MOD_ALT) - strcat(name, " alt"); - if (mods & GLFW_MOD_SUPER) - strcat(name, " super"); - - return name; -} - -static const char* get_character_string(int codepoint) -{ - // This assumes UTF-8, which is stupid - static char result[6 + 1]; - - int length = wctomb(result, codepoint); - if (length == -1) - length = 0; - - result[length] = '\0'; - return result; -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void window_pos_callback(GLFWwindow* window, int x, int y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window position: %i %i\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void window_size_callback(GLFWwindow* window, int width, int height) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window size: %i %i\n", - counter++, slot->number, glfwGetTime(), width, height); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Framebuffer size: %i %i\n", - counter++, slot->number, glfwGetTime(), width, height); - - glViewport(0, 0, width, height); -} - -static void window_close_callback(GLFWwindow* window) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window close\n", - counter++, slot->number, glfwGetTime()); - - glfwSetWindowShouldClose(window, slot->closeable); -} - -static void window_refresh_callback(GLFWwindow* window) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window refresh\n", - counter++, slot->number, glfwGetTime()); - - glfwMakeContextCurrent(window); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); -} - -static void window_focus_callback(GLFWwindow* window, int focused) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window %s\n", - counter++, slot->number, glfwGetTime(), - focused ? "focused" : "defocused"); -} - -static void window_iconify_callback(GLFWwindow* window, int iconified) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window was %s\n", - counter++, slot->number, glfwGetTime(), - iconified ? "iconified" : "restored"); -} - -static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Mouse button %i (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), button, - get_button_name(button), - get_mods_name(mods), - get_action_name(action)); -} - -static void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Cursor position: %f %f\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void cursor_enter_callback(GLFWwindow* window, int entered) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Cursor %s window\n", - counter++, slot->number, glfwGetTime(), - entered ? "entered" : "left"); -} - -static void scroll_callback(GLFWwindow* window, double x, double y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Scroll: %0.3f %0.3f\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - Slot* slot = glfwGetWindowUserPointer(window); - - printf("%08x to %i at %0.3f: Key 0x%04x Scancode 0x%04x (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), key, scancode, - get_key_name(key), - get_mods_name(mods), - get_action_name(action)); - - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_C: - { - slot->closeable = !slot->closeable; - - printf("(( closing %s ))\n", slot->closeable ? "enabled" : "disabled"); - break; - } - } -} - -static void char_callback(GLFWwindow* window, unsigned int codepoint) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Character 0x%08x (%s) input\n", - counter++, slot->number, glfwGetTime(), codepoint, - get_character_string(codepoint)); -} - -static void char_mods_callback(GLFWwindow* window, unsigned int codepoint, int mods) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Character 0x%08x (%s) with modifiers (with%s) input\n", - counter++, slot->number, glfwGetTime(), codepoint, - get_character_string(codepoint), - get_mods_name(mods)); -} - -static void drop_callback(GLFWwindow* window, int count, const char** paths) -{ - int i; - Slot* slot = glfwGetWindowUserPointer(window); - - printf("%08x to %i at %0.3f: Drop input\n", - counter++, slot->number, glfwGetTime()); - - for (i = 0; i < count; i++) - printf(" %i: \"%s\"\n", i, paths[i]); -} - -static void monitor_callback(GLFWmonitor* monitor, int event) -{ - if (event == GLFW_CONNECTED) - { - int x, y, widthMM, heightMM; - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwGetMonitorPos(monitor, &x, &y); - glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM); - - printf("%08x at %0.3f: Monitor %s (%ix%i at %ix%i, %ix%i mm) was connected\n", - counter++, - glfwGetTime(), - glfwGetMonitorName(monitor), - mode->width, mode->height, - x, y, - widthMM, heightMM); - } - else - { - printf("%08x at %0.3f: Monitor %s was disconnected\n", - counter++, - glfwGetTime(), - glfwGetMonitorName(monitor)); - } -} - -int main(int argc, char** argv) -{ - Slot* slots; - GLFWmonitor* monitor = NULL; - int ch, i, width, height, count = 1; - - setlocale(LC_ALL, ""); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - printf("Library initialized\n"); - - glfwSetMonitorCallback(monitor_callback); - - while ((ch = getopt(argc, argv, "hfn:")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - - case 'n': - count = (int) strtol(optarg, NULL, 10); - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - if (!count) - { - fprintf(stderr, "Invalid user\n"); - exit(EXIT_FAILURE); - } - - slots = calloc(count, sizeof(Slot)); - - for (i = 0; i < count; i++) - { - char title[128]; - - slots[i].closeable = GL_TRUE; - slots[i].number = i + 1; - - sprintf(title, "Event Linter (Window %i)", slots[i].number); - - if (monitor) - { - printf("Creating full screen window %i (%ix%i on %s)\n", - slots[i].number, - width, height, - glfwGetMonitorName(monitor)); - } - else - { - printf("Creating windowed mode window %i (%ix%i)\n", - slots[i].number, - width, height); - } - - slots[i].window = glfwCreateWindow(width, height, title, monitor, NULL); - if (!slots[i].window) - { - free(slots); - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetWindowUserPointer(slots[i].window, slots + i); - - glfwSetWindowPosCallback(slots[i].window, window_pos_callback); - glfwSetWindowSizeCallback(slots[i].window, window_size_callback); - glfwSetFramebufferSizeCallback(slots[i].window, framebuffer_size_callback); - glfwSetWindowCloseCallback(slots[i].window, window_close_callback); - glfwSetWindowRefreshCallback(slots[i].window, window_refresh_callback); - glfwSetWindowFocusCallback(slots[i].window, window_focus_callback); - glfwSetWindowIconifyCallback(slots[i].window, window_iconify_callback); - glfwSetMouseButtonCallback(slots[i].window, mouse_button_callback); - glfwSetCursorPosCallback(slots[i].window, cursor_position_callback); - glfwSetCursorEnterCallback(slots[i].window, cursor_enter_callback); - glfwSetScrollCallback(slots[i].window, scroll_callback); - glfwSetKeyCallback(slots[i].window, key_callback); - glfwSetCharCallback(slots[i].window, char_callback); - glfwSetCharModsCallback(slots[i].window, char_mods_callback); - glfwSetDropCallback(slots[i].window, drop_callback); - - glfwMakeContextCurrent(slots[i].window); - glfwSwapInterval(1); - } - - printf("Main loop starting\n"); - - for (;;) - { - for (i = 0; i < count; i++) - { - if (glfwWindowShouldClose(slots[i].window)) - break; - } - - if (i < count) - break; - - glfwWaitEvents(); - - // Workaround for an issue with msvcrt and mintty - fflush(stdout); - } - - free(slots); - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/fsaa.c b/testbed/nanogui/ext/glfw/tests/fsaa.c deleted file mode 100644 index b368745a..00000000 --- a/testbed/nanogui/ext/glfw/tests/fsaa.c +++ /dev/null @@ -1,162 +0,0 @@ -//======================================================================== -// Full screen anti-aliasing test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test renders two high contrast, slowly rotating quads, one aliased -// and one (hopefully) anti-aliased, thus allowing for visual verification -// of whether FSAA is indeed enabled -// -//======================================================================== - -#define GLFW_INCLUDE_GLEXT -#include - -#include -#include - -#include "getopt.h" - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_SPACE: - glfwSetTime(0.0); - break; - } -} - -static void usage(void) -{ - printf("Usage: fsaa [-h] [-s SAMPLES]\n"); -} - -int main(int argc, char** argv) -{ - int ch, samples = 4; - GLFWwindow* window; - - while ((ch = getopt(argc, argv, "hs:")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - case 's': - samples = atoi(optarg); - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - if (samples) - printf("Requesting FSAA with %i samples\n", samples); - else - printf("Requesting that FSAA not be available\n"); - - glfwWindowHint(GLFW_SAMPLES, samples); - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - window = glfwCreateWindow(800, 400, "Aliasing Detector", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - if (!glfwExtensionSupported("GL_ARB_multisample")) - { - printf("GL_ARB_multisample extension not supported\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwShowWindow(window); - - glGetIntegerv(GL_SAMPLES_ARB, &samples); - if (samples) - printf("Context reports FSAA is available with %i samples\n", samples); - else - printf("Context reports FSAA is unavailable\n"); - - glMatrixMode(GL_PROJECTION); - glOrtho(0.f, 1.f, 0.f, 0.5f, 0.f, 1.f); - glMatrixMode(GL_MODELVIEW); - - while (!glfwWindowShouldClose(window)) - { - GLfloat time = (GLfloat) glfwGetTime(); - - glClear(GL_COLOR_BUFFER_BIT); - - glLoadIdentity(); - glTranslatef(0.25f, 0.25f, 0.f); - glRotatef(time, 0.f, 0.f, 1.f); - - glDisable(GL_MULTISAMPLE_ARB); - glRectf(-0.15f, -0.15f, 0.15f, 0.15f); - - glLoadIdentity(); - glTranslatef(0.75f, 0.25f, 0.f); - glRotatef(time, 0.f, 0.f, 1.f); - - glEnable(GL_MULTISAMPLE_ARB); - glRectf(-0.15f, -0.15f, 0.15f, 0.15f); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/gamma.c b/testbed/nanogui/ext/glfw/tests/gamma.c deleted file mode 100644 index 93a24e6f..00000000 --- a/testbed/nanogui/ext/glfw/tests/gamma.c +++ /dev/null @@ -1,181 +0,0 @@ -//======================================================================== -// Gamma correction test program -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This program is used to test the gamma correction functionality for -// both full screen and windowed mode windows -// -//======================================================================== - -#include - -#include -#include - -#include "getopt.h" - -#define STEP_SIZE 0.1f - -static GLfloat gamma_value = 1.0f; - -static void usage(void) -{ - printf("Usage: gamma [-h] [-f]\n"); -} - -static void set_gamma(GLFWwindow* window, float value) -{ - GLFWmonitor* monitor = glfwGetWindowMonitor(window); - if (!monitor) - monitor = glfwGetPrimaryMonitor(); - - gamma_value = value; - printf("Gamma: %f\n", gamma_value); - glfwSetGamma(monitor, gamma_value); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - { - glfwSetWindowShouldClose(window, GL_TRUE); - break; - } - - case GLFW_KEY_KP_ADD: - case GLFW_KEY_Q: - { - set_gamma(window, gamma_value + STEP_SIZE); - break; - } - - case GLFW_KEY_KP_SUBTRACT: - case GLFW_KEY_W: - { - if (gamma_value - STEP_SIZE > 0.f) - set_gamma(window, gamma_value - STEP_SIZE); - - break; - } - } -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -int main(int argc, char** argv) -{ - int width, height, ch; - GLFWmonitor* monitor = NULL; - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - while ((ch = getopt(argc, argv, "fh")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = 200; - height = 200; - } - - window = glfwCreateWindow(width, height, "Gamma Test", monitor, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - set_gamma(window, 1.f); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - glMatrixMode(GL_PROJECTION); - glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); - glMatrixMode(GL_MODELVIEW); - - glClearColor(0.5f, 0.5f, 0.5f, 0); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glColor3f(0.8f, 0.2f, 0.4f); - glRectf(-0.5f, -0.5f, 0.5f, 0.5f); - - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/glfwinfo.c b/testbed/nanogui/ext/glfw/tests/glfwinfo.c deleted file mode 100644 index f07d7006..00000000 --- a/testbed/nanogui/ext/glfw/tests/glfwinfo.c +++ /dev/null @@ -1,429 +0,0 @@ -//======================================================================== -// Version information dumper -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test is a pale imitation of glxinfo(1), except not really -// -// It dumps GLFW and OpenGL version information -// -//======================================================================== - -#include -#include - -#include -#include -#include - -#include "getopt.h" - -#ifdef _MSC_VER -#define strcasecmp(x, y) _stricmp(x, y) -#endif - -#define API_OPENGL "gl" -#define API_OPENGL_ES "es" - -#define PROFILE_NAME_CORE "core" -#define PROFILE_NAME_COMPAT "compat" - -#define STRATEGY_NAME_NONE "none" -#define STRATEGY_NAME_LOSE "lose" - -#define BEHAVIOR_NAME_NONE "none" -#define BEHAVIOR_NAME_FLUSH "flush" - -static void usage(void) -{ - printf("Usage: glfwinfo [-h] [-a API] [-m MAJOR] [-n MINOR] [-d] [-l] [-f] [-p PROFILE] [-s STRATEGY] [-b BEHAVIOR]\n"); - printf("Options:\n"); - printf(" -a the client API to use (" API_OPENGL " or " API_OPENGL_ES ")\n"); - printf(" -b the release behavior to use (" BEHAVIOR_NAME_NONE " or " BEHAVIOR_NAME_FLUSH ")\n"); - printf(" -d request a debug context\n"); - printf(" -f require a forward-compatible context\n"); - printf(" -h show this help\n"); - printf(" -l list all client API extensions after context creation\n"); - printf(" -m the major number of the required client API version\n"); - printf(" -n the minor number of the required client API version\n"); - printf(" -p the OpenGL profile to use (" PROFILE_NAME_CORE " or " PROFILE_NAME_COMPAT ")\n"); - printf(" -s the robustness strategy to use (" STRATEGY_NAME_NONE " or " STRATEGY_NAME_LOSE ")\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static const char* get_client_api_name(int api) -{ - if (api == GLFW_OPENGL_API) - return "OpenGL"; - else if (api == GLFW_OPENGL_ES_API) - return "OpenGL ES"; - - return "Unknown API"; -} - -static const char* get_profile_name_gl(GLint mask) -{ - if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) - return PROFILE_NAME_COMPAT; - if (mask & GL_CONTEXT_CORE_PROFILE_BIT) - return PROFILE_NAME_CORE; - - return "unknown"; -} - -static const char* get_profile_name_glfw(int profile) -{ - if (profile == GLFW_OPENGL_COMPAT_PROFILE) - return PROFILE_NAME_COMPAT; - if (profile == GLFW_OPENGL_CORE_PROFILE) - return PROFILE_NAME_CORE; - - return "unknown"; -} - -static const char* get_strategy_name_gl(GLint strategy) -{ - if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB) - return STRATEGY_NAME_LOSE; - if (strategy == GL_NO_RESET_NOTIFICATION_ARB) - return STRATEGY_NAME_NONE; - - return "unknown"; -} - -static const char* get_strategy_name_glfw(int strategy) -{ - if (strategy == GLFW_LOSE_CONTEXT_ON_RESET) - return STRATEGY_NAME_LOSE; - if (strategy == GLFW_NO_RESET_NOTIFICATION) - return STRATEGY_NAME_NONE; - - return "unknown"; -} - -static void list_extensions(int api, int major, int minor) -{ - int i; - GLint count; - const GLubyte* extensions; - - printf("%s context supported extensions:\n", get_client_api_name(api)); - - if (api == GLFW_OPENGL_API && major > 2) - { - PFNGLGETSTRINGIPROC glGetStringi = (PFNGLGETSTRINGIPROC) glfwGetProcAddress("glGetStringi"); - if (!glGetStringi) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glGetIntegerv(GL_NUM_EXTENSIONS, &count); - - for (i = 0; i < count; i++) - puts((const char*) glGetStringi(GL_EXTENSIONS, i)); - } - else - { - extensions = glGetString(GL_EXTENSIONS); - while (*extensions != '\0') - { - if (*extensions == ' ') - putchar('\n'); - else - putchar(*extensions); - - extensions++; - } - } - - putchar('\n'); -} - -static GLboolean valid_version(void) -{ - int major, minor, revision; - - glfwGetVersion(&major, &minor, &revision); - - printf("GLFW header version: %u.%u.%u\n", - GLFW_VERSION_MAJOR, - GLFW_VERSION_MINOR, - GLFW_VERSION_REVISION); - - printf("GLFW library version: %u.%u.%u\n", major, minor, revision); - - if (major != GLFW_VERSION_MAJOR) - { - printf("*** ERROR: GLFW major version mismatch! ***\n"); - return GL_FALSE; - } - - if (minor != GLFW_VERSION_MINOR || revision != GLFW_VERSION_REVISION) - printf("*** WARNING: GLFW version mismatch! ***\n"); - - printf("GLFW library version string: \"%s\"\n", glfwGetVersionString()); - return GL_TRUE; -} - -int main(int argc, char** argv) -{ - int ch, api = 0, profile = 0, strategy = 0, behavior = 0, major = 1, minor = 0, revision; - GLboolean debug = GL_FALSE, forward = GL_FALSE, list = GL_FALSE; - GLint flags, mask; - GLFWwindow* window; - - while ((ch = getopt(argc, argv, "a:b:dfhlm:n:p:s:")) != -1) - { - switch (ch) - { - case 'a': - if (strcasecmp(optarg, API_OPENGL) == 0) - api = GLFW_OPENGL_API; - else if (strcasecmp(optarg, API_OPENGL_ES) == 0) - api = GLFW_OPENGL_ES_API; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'b': - if (strcasecmp(optarg, BEHAVIOR_NAME_NONE) == 0) - behavior = GLFW_RELEASE_BEHAVIOR_NONE; - else if (strcasecmp(optarg, BEHAVIOR_NAME_FLUSH) == 0) - behavior = GLFW_RELEASE_BEHAVIOR_FLUSH; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'd': - debug = GL_TRUE; - break; - case 'f': - forward = GL_TRUE; - break; - case 'h': - usage(); - exit(EXIT_SUCCESS); - case 'l': - list = GL_TRUE; - break; - case 'm': - major = atoi(optarg); - break; - case 'n': - minor = atoi(optarg); - break; - case 'p': - if (strcasecmp(optarg, PROFILE_NAME_CORE) == 0) - profile = GLFW_OPENGL_CORE_PROFILE; - else if (strcasecmp(optarg, PROFILE_NAME_COMPAT) == 0) - profile = GLFW_OPENGL_COMPAT_PROFILE; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 's': - if (strcasecmp(optarg, STRATEGY_NAME_NONE) == 0) - strategy = GLFW_NO_RESET_NOTIFICATION; - else if (strcasecmp(optarg, STRATEGY_NAME_LOSE) == 0) - strategy = GLFW_LOSE_CONTEXT_ON_RESET; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - // Initialize GLFW and create window - - if (!valid_version()) - exit(EXIT_FAILURE); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - if (major != 1 || minor != 0) - { - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, major); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minor); - } - - if (api != 0) - glfwWindowHint(GLFW_CLIENT_API, api); - - if (debug) - glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); - - if (forward) - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - - if (profile != 0) - glfwWindowHint(GLFW_OPENGL_PROFILE, profile); - - if (strategy) - glfwWindowHint(GLFW_CONTEXT_ROBUSTNESS, strategy); - - if (behavior) - glfwWindowHint(GLFW_CONTEXT_RELEASE_BEHAVIOR, behavior); - - glfwWindowHint(GLFW_RED_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_GREEN_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_BLUE_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ALPHA_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_DEPTH_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_STENCIL_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ACCUM_RED_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ACCUM_GREEN_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ACCUM_BLUE_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ACCUM_ALPHA_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_AUX_BUFFERS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_SAMPLES, GLFW_DONT_CARE); - glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_DONT_CARE); - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - window = glfwCreateWindow(200, 200, "Version", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - - // Report client API version - - api = glfwGetWindowAttrib(window, GLFW_CLIENT_API); - major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR); - minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR); - revision = glfwGetWindowAttrib(window, GLFW_CONTEXT_REVISION); - - printf("%s context version string: \"%s\"\n", - get_client_api_name(api), - glGetString(GL_VERSION)); - - printf("%s context version parsed by GLFW: %u.%u.%u\n", - get_client_api_name(api), - major, minor, revision); - - // Report client API context properties - - if (api == GLFW_OPENGL_API) - { - if (major >= 3) - { - glGetIntegerv(GL_CONTEXT_FLAGS, &flags); - printf("%s context flags (0x%08x):", get_client_api_name(api), flags); - - if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) - printf(" forward-compatible"); - if (flags & GL_CONTEXT_FLAG_DEBUG_BIT) - printf(" debug"); - if (flags & GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB) - printf(" robustness"); - putchar('\n'); - - printf("%s context flags parsed by GLFW:", get_client_api_name(api)); - - if (glfwGetWindowAttrib(window, GLFW_OPENGL_FORWARD_COMPAT)) - printf(" forward-compatible"); - if (glfwGetWindowAttrib(window, GLFW_OPENGL_DEBUG_CONTEXT)) - printf(" debug"); - if (glfwGetWindowAttrib(window, GLFW_CONTEXT_ROBUSTNESS) != GLFW_NO_ROBUSTNESS) - printf(" robustness"); - putchar('\n'); - } - - if (major > 3 || (major == 3 && minor >= 2)) - { - int profile = glfwGetWindowAttrib(window, GLFW_OPENGL_PROFILE); - - glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask); - printf("%s profile mask (0x%08x): %s\n", - get_client_api_name(api), - mask, - get_profile_name_gl(mask)); - - printf("%s profile mask parsed by GLFW: %s\n", - get_client_api_name(api), - get_profile_name_glfw(profile)); - } - - if (glfwExtensionSupported("GL_ARB_robustness")) - { - int robustness; - GLint strategy; - glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy); - - printf("%s robustness strategy (0x%08x): %s\n", - get_client_api_name(api), - strategy, - get_strategy_name_gl(strategy)); - - robustness = glfwGetWindowAttrib(window, GLFW_CONTEXT_ROBUSTNESS); - - printf("%s robustness strategy parsed by GLFW: %s\n", - get_client_api_name(api), - get_strategy_name_glfw(robustness)); - } - } - - printf("%s context renderer string: \"%s\"\n", - get_client_api_name(api), - glGetString(GL_RENDERER)); - printf("%s context vendor string: \"%s\"\n", - get_client_api_name(api), - glGetString(GL_VENDOR)); - - if (major > 1) - { - printf("%s context shading language version: \"%s\"\n", - get_client_api_name(api), - glGetString(GL_SHADING_LANGUAGE_VERSION)); - } - - // Report client API extensions - if (list) - list_extensions(api, major, minor); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/iconify.c b/testbed/nanogui/ext/glfw/tests/iconify.c deleted file mode 100644 index 037b85ac..00000000 --- a/testbed/nanogui/ext/glfw/tests/iconify.c +++ /dev/null @@ -1,254 +0,0 @@ -//======================================================================== -// Iconify/restore test program -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This program is used to test the iconify/restore functionality for -// both full screen and windowed mode windows -// -//======================================================================== - -#include - -#include -#include - -#include "getopt.h" - -static void usage(void) -{ - printf("Usage: iconify [-h] [-f [-a] [-n]]\n"); - printf("Options:\n"); - printf(" -a create windows for all monitors\n"); - printf(" -f create full screen window(s)\n"); - printf(" -h show this help\n"); - printf(" -n no automatic iconification of full screen windows\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - printf("%0.2f Key %s\n", - glfwGetTime(), - action == GLFW_PRESS ? "pressed" : "released"); - - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_SPACE: - glfwIconifyWindow(window); - break; - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - } -} - -static void window_size_callback(GLFWwindow* window, int width, int height) -{ - printf("%0.2f Window resized to %ix%i\n", glfwGetTime(), width, height); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - printf("%0.2f Framebuffer resized to %ix%i\n", glfwGetTime(), width, height); - - glViewport(0, 0, width, height); -} - -static void window_focus_callback(GLFWwindow* window, int focused) -{ - printf("%0.2f Window %s\n", - glfwGetTime(), - focused ? "focused" : "defocused"); -} - -static void window_iconify_callback(GLFWwindow* window, int iconified) -{ - printf("%0.2f Window %s\n", - glfwGetTime(), - iconified ? "iconified" : "restored"); -} - -static void window_refresh_callback(GLFWwindow* window) -{ - int width, height; - glfwGetFramebufferSize(window, &width, &height); - - glfwMakeContextCurrent(window); - - glEnable(GL_SCISSOR_TEST); - - glScissor(0, 0, width, height); - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); - - glScissor(0, 0, 640, 480); - glClearColor(1, 1, 1, 0); - glClear(GL_COLOR_BUFFER_BIT); - - glfwSwapBuffers(window); -} - -static GLFWwindow* create_window(GLFWmonitor* monitor) -{ - int width, height; - GLFWwindow* window; - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - window = glfwCreateWindow(width, height, "Iconify", monitor, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - return window; -} - -int main(int argc, char** argv) -{ - int ch, i, window_count; - GLboolean auto_iconify = GL_TRUE, fullscreen = GL_FALSE, all_monitors = GL_FALSE; - GLFWwindow** windows; - - while ((ch = getopt(argc, argv, "afhn")) != -1) - { - switch (ch) - { - case 'a': - all_monitors = GL_TRUE; - break; - - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - fullscreen = GL_TRUE; - break; - - case 'n': - auto_iconify = GL_FALSE; - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_AUTO_ICONIFY, auto_iconify); - - if (fullscreen && all_monitors) - { - int monitor_count; - GLFWmonitor** monitors = glfwGetMonitors(&monitor_count); - - window_count = monitor_count; - windows = calloc(window_count, sizeof(GLFWwindow*)); - - for (i = 0; i < monitor_count; i++) - { - windows[i] = create_window(monitors[i]); - if (!windows[i]) - break; - } - } - else - { - GLFWmonitor* monitor = NULL; - - if (fullscreen) - monitor = glfwGetPrimaryMonitor(); - - window_count = 1; - windows = calloc(window_count, sizeof(GLFWwindow*)); - windows[0] = create_window(monitor); - } - - for (i = 0; i < window_count; i++) - { - glfwSetKeyCallback(windows[i], key_callback); - glfwSetFramebufferSizeCallback(windows[i], framebuffer_size_callback); - glfwSetWindowSizeCallback(windows[i], window_size_callback); - glfwSetWindowFocusCallback(windows[i], window_focus_callback); - glfwSetWindowIconifyCallback(windows[i], window_iconify_callback); - glfwSetWindowRefreshCallback(windows[i], window_refresh_callback); - - window_refresh_callback(windows[i]); - - printf("Window is %s and %s\n", - glfwGetWindowAttrib(windows[i], GLFW_ICONIFIED) ? "iconified" : "restored", - glfwGetWindowAttrib(windows[i], GLFW_FOCUSED) ? "focused" : "defocused"); - } - - for (;;) - { - glfwPollEvents(); - - for (i = 0; i < window_count; i++) - { - if (glfwWindowShouldClose(windows[i])) - break; - } - - if (i < window_count) - break; - - // Workaround for an issue with msvcrt and mintty - fflush(stdout); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/joysticks.c b/testbed/nanogui/ext/glfw/tests/joysticks.c deleted file mode 100644 index 0d6b2c3a..00000000 --- a/testbed/nanogui/ext/glfw/tests/joysticks.c +++ /dev/null @@ -1,235 +0,0 @@ -//======================================================================== -// Joystick input test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test displays the state of every button and axis of every connected -// joystick and/or gamepad -// -//======================================================================== - -#include - -#include -#include -#include - -#ifdef _MSC_VER -#define strdup(x) _strdup(x) -#endif - -typedef struct Joystick -{ - GLboolean present; - char* name; - float* axes; - unsigned char* buttons; - int axis_count; - int button_count; -} Joystick; - -static Joystick joysticks[GLFW_JOYSTICK_LAST - GLFW_JOYSTICK_1 + 1]; -static int joystick_count = 0; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static void draw_joystick(Joystick* j, int x, int y, int width, int height) -{ - int i; - const int axis_height = 3 * height / 4; - const int button_height = height / 4; - - if (j->axis_count) - { - const int axis_width = width / j->axis_count; - - for (i = 0; i < j->axis_count; i++) - { - float value = j->axes[i] / 2.f + 0.5f; - - glColor3f(0.3f, 0.3f, 0.3f); - glRecti(x + i * axis_width, - y, - x + (i + 1) * axis_width, - y + axis_height); - - glColor3f(1.f, 1.f, 1.f); - glRecti(x + i * axis_width, - y + (int) (value * (axis_height - 5)), - x + (i + 1) * axis_width, - y + 5 + (int) (value * (axis_height - 5))); - } - } - - if (j->button_count) - { - const int button_width = width / j->button_count; - - for (i = 0; i < j->button_count; i++) - { - if (j->buttons[i]) - glColor3f(1.f, 1.f, 1.f); - else - glColor3f(0.3f, 0.3f, 0.3f); - - glRecti(x + i * button_width, - y + axis_height, - x + (i + 1) * button_width, - y + axis_height + button_height); - } - } -} - -static void draw_joysticks(GLFWwindow* window) -{ - int i, width, height, offset = 0; - - glfwGetFramebufferSize(window, &width, &height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.f, width, height, 0.f, 1.f, -1.f); - glMatrixMode(GL_MODELVIEW); - - for (i = 0; i < sizeof(joysticks) / sizeof(Joystick); i++) - { - Joystick* j = joysticks + i; - - if (j->present) - { - draw_joystick(j, - 0, offset * height / joystick_count, - width, height / joystick_count); - offset++; - } - } -} - -static void refresh_joysticks(void) -{ - int i; - - for (i = 0; i < sizeof(joysticks) / sizeof(Joystick); i++) - { - Joystick* j = joysticks + i; - - if (glfwJoystickPresent(GLFW_JOYSTICK_1 + i)) - { - const float* axes; - const unsigned char* buttons; - int axis_count, button_count; - - free(j->name); - j->name = strdup(glfwGetJoystickName(GLFW_JOYSTICK_1 + i)); - - axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1 + i, &axis_count); - if (axis_count != j->axis_count) - { - j->axis_count = axis_count; - j->axes = realloc(j->axes, j->axis_count * sizeof(float)); - } - - memcpy(j->axes, axes, axis_count * sizeof(float)); - - buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_1 + i, &button_count); - if (button_count != j->button_count) - { - j->button_count = button_count; - j->buttons = realloc(j->buttons, j->button_count); - } - - memcpy(j->buttons, buttons, button_count * sizeof(unsigned char)); - - if (!j->present) - { - printf("Found joystick %i named \'%s\' with %i axes, %i buttons\n", - i + 1, j->name, j->axis_count, j->button_count); - - joystick_count++; - } - - j->present = GL_TRUE; - } - else - { - if (j->present) - { - printf("Lost joystick %i named \'%s\'\n", i + 1, j->name); - - free(j->name); - free(j->axes); - free(j->buttons); - memset(j, 0, sizeof(Joystick)); - - joystick_count--; - } - } - } -} - -int main(void) -{ - GLFWwindow* window; - - memset(joysticks, 0, sizeof(joysticks)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Joystick Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - refresh_joysticks(); - draw_joysticks(window); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/monitors.c b/testbed/nanogui/ext/glfw/tests/monitors.c deleted file mode 100644 index 47f12faf..00000000 --- a/testbed/nanogui/ext/glfw/tests/monitors.c +++ /dev/null @@ -1,241 +0,0 @@ -//======================================================================== -// Monitor information tool -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test prints monitor and video mode information or verifies video -// modes -// -//======================================================================== - -#include - -#include -#include -#include - -#include "getopt.h" - -enum Mode -{ - LIST_MODE, - TEST_MODE -}; - -static void usage(void) -{ - printf("Usage: monitors [-t]\n"); - printf(" monitors -h\n"); -} - -static const char* format_mode(const GLFWvidmode* mode) -{ - static char buffer[512]; - - sprintf(buffer, - "%i x %i x %i (%i %i %i) %i Hz", - mode->width, mode->height, - mode->redBits + mode->greenBits + mode->blueBits, - mode->redBits, mode->greenBits, mode->blueBits, - mode->refreshRate); - - buffer[sizeof(buffer) - 1] = '\0'; - return buffer; -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - printf("Framebuffer resized to %ix%i\n", width, height); - - glViewport(0, 0, width, height); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -static void list_modes(GLFWmonitor* monitor) -{ - int count, x, y, widthMM, heightMM, dpi, i; - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); - - glfwGetMonitorPos(monitor, &x, &y); - glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM); - - printf("Name: %s (%s)\n", - glfwGetMonitorName(monitor), - glfwGetPrimaryMonitor() == monitor ? "primary" : "secondary"); - printf("Current mode: %s\n", format_mode(mode)); - printf("Virtual position: %i %i\n", x, y); - - dpi = (int) ((float) mode->width * 25.4f / (float) widthMM); - printf("Physical size: %i x %i mm (%i dpi)\n", widthMM, heightMM, dpi); - - printf("Modes:\n"); - - for (i = 0; i < count; i++) - { - printf("%3u: %s", (unsigned int) i, format_mode(modes + i)); - - if (memcmp(mode, modes + i, sizeof(GLFWvidmode)) == 0) - printf(" (current mode)"); - - putchar('\n'); - } -} - -static void test_modes(GLFWmonitor* monitor) -{ - int i, count; - GLFWwindow* window; - const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); - - for (i = 0; i < count; i++) - { - const GLFWvidmode* mode = modes + i; - GLFWvidmode current; - - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - - printf("Testing mode %u on monitor %s: %s\n", - (unsigned int) i, - glfwGetMonitorName(monitor), - format_mode(mode)); - - window = glfwCreateWindow(mode->width, mode->height, - "Video Mode Test", - glfwGetPrimaryMonitor(), - NULL); - if (!window) - { - printf("Failed to enter mode %u: %s\n", - (unsigned int) i, - format_mode(mode)); - continue; - } - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetTime(0.0); - - while (glfwGetTime() < 5.0) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - glfwPollEvents(); - - if (glfwWindowShouldClose(window)) - { - printf("User terminated program\n"); - - glfwTerminate(); - exit(EXIT_SUCCESS); - } - } - - glGetIntegerv(GL_RED_BITS, ¤t.redBits); - glGetIntegerv(GL_GREEN_BITS, ¤t.greenBits); - glGetIntegerv(GL_BLUE_BITS, ¤t.blueBits); - - glfwGetWindowSize(window, ¤t.width, ¤t.height); - - if (current.redBits != mode->redBits || - current.greenBits != mode->greenBits || - current.blueBits != mode->blueBits) - { - printf("*** Color bit mismatch: (%i %i %i) instead of (%i %i %i)\n", - current.redBits, current.greenBits, current.blueBits, - mode->redBits, mode->greenBits, mode->blueBits); - } - - if (current.width != mode->width || current.height != mode->height) - { - printf("*** Size mismatch: %ix%i instead of %ix%i\n", - current.width, current.height, - mode->width, mode->height); - } - - printf("Closing window\n"); - - glfwDestroyWindow(window); - window = NULL; - - glfwPollEvents(); - } -} - -int main(int argc, char** argv) -{ - int ch, i, count, mode = LIST_MODE; - GLFWmonitor** monitors; - - while ((ch = getopt(argc, argv, "th")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - case 't': - mode = TEST_MODE; - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - monitors = glfwGetMonitors(&count); - - for (i = 0; i < count; i++) - { - if (mode == LIST_MODE) - list_modes(monitors[i]); - else if (mode == TEST_MODE) - test_modes(monitors[i]); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/peter.c b/testbed/nanogui/ext/glfw/tests/peter.c deleted file mode 100644 index 723167ad..00000000 --- a/testbed/nanogui/ext/glfw/tests/peter.c +++ /dev/null @@ -1,151 +0,0 @@ -//======================================================================== -// Cursor mode test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test allows you to switch between the various cursor modes -// -//======================================================================== - -#include - -#include -#include - -static GLboolean reopen = GL_FALSE; -static double cursor_x; -static double cursor_y; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - printf("%0.3f: Cursor position: %f %f (%f %f)\n", - glfwGetTime(), - x, y, x - cursor_x, y - cursor_y); - - cursor_x = x; - cursor_y = y; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_D: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - printf("(( cursor is disabled ))\n"); - break; - - case GLFW_KEY_H: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - printf("(( cursor is hidden ))\n"); - break; - - case GLFW_KEY_N: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - printf("(( cursor is normal ))\n"); - break; - - case GLFW_KEY_R: - reopen = GL_TRUE; - break; - } -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static GLFWwindow* open_window(void) -{ - GLFWwindow* window = glfwCreateWindow(640, 480, "Peter Detector", NULL, NULL); - if (!window) - return NULL; - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwGetCursorPos(window, &cursor_x, &cursor_y); - printf("Cursor position: %f %f\n", cursor_x, cursor_y); - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetCursorPosCallback(window, cursor_position_callback); - glfwSetKeyCallback(window, key_callback); - - return window; -} - -int main(void) -{ - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = open_window(); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glClearColor(0.f, 0.f, 0.f, 0.f); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glfwSwapBuffers(window); - glfwWaitEvents(); - - if (reopen) - { - glfwDestroyWindow(window); - window = open_window(); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - reopen = GL_FALSE; - } - - // Workaround for an issue with msvcrt and mintty - fflush(stdout); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/reopen.c b/testbed/nanogui/ext/glfw/tests/reopen.c deleted file mode 100644 index 7af8e8a9..00000000 --- a/testbed/nanogui/ext/glfw/tests/reopen.c +++ /dev/null @@ -1,177 +0,0 @@ -//======================================================================== -// Window re-opener (open/close stress test) -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test came about as the result of bug #1262773 -// -// It closes and re-opens the GLFW window every five seconds, alternating -// between windowed and full screen mode -// -// It also times and logs opening and closing actions and attempts to separate -// user initiated window closing from its own -// -//======================================================================== - -#include - -#include -#include -#include - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static void window_close_callback(GLFWwindow* window) -{ - printf("Close callback triggered\n"); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_Q: - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - } -} - -static GLFWwindow* open_window(int width, int height, GLFWmonitor* monitor) -{ - double base; - GLFWwindow* window; - - base = glfwGetTime(); - - window = glfwCreateWindow(width, height, "Window Re-opener", monitor, NULL); - if (!window) - return NULL; - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetWindowCloseCallback(window, window_close_callback); - glfwSetKeyCallback(window, key_callback); - - if (monitor) - { - printf("Opening full screen window on monitor %s took %0.3f seconds\n", - glfwGetMonitorName(monitor), - glfwGetTime() - base); - } - else - { - printf("Opening regular window took %0.3f seconds\n", - glfwGetTime() - base); - } - - return window; -} - -static void close_window(GLFWwindow* window) -{ - double base = glfwGetTime(); - glfwDestroyWindow(window); - printf("Closing window took %0.3f seconds\n", glfwGetTime() - base); -} - -int main(int argc, char** argv) -{ - int count = 0; - GLFWwindow* window; - - srand((unsigned int) time(NULL)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - for (;;) - { - GLFWmonitor* monitor = NULL; - - if (count % 2 == 0) - { - int monitorCount; - GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); - monitor = monitors[rand() % monitorCount]; - } - - window = open_window(640, 480, monitor); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glMatrixMode(GL_PROJECTION); - glOrtho(-1.f, 1.f, -1.f, 1.f, 1.f, -1.f); - glMatrixMode(GL_MODELVIEW); - - glfwSetTime(0.0); - - while (glfwGetTime() < 5.0) - { - glClear(GL_COLOR_BUFFER_BIT); - - glPushMatrix(); - glRotatef((GLfloat) glfwGetTime() * 100.f, 0.f, 0.f, 1.f); - glRectf(-0.5f, -0.5f, 1.f, 1.f); - glPopMatrix(); - - glfwSwapBuffers(window); - glfwPollEvents(); - - if (glfwWindowShouldClose(window)) - { - close_window(window); - printf("User closed window\n"); - - glfwTerminate(); - exit(EXIT_SUCCESS); - } - } - - printf("Closing window\n"); - close_window(window); - - count++; - } - - glfwTerminate(); -} - diff --git a/testbed/nanogui/ext/glfw/tests/sharing.c b/testbed/nanogui/ext/glfw/tests/sharing.c deleted file mode 100644 index 54b15c81..00000000 --- a/testbed/nanogui/ext/glfw/tests/sharing.c +++ /dev/null @@ -1,184 +0,0 @@ -//======================================================================== -// Context sharing test program -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This program is used to test sharing of objects between contexts -// -//======================================================================== - -#include - -#include -#include - -#define WIDTH 400 -#define HEIGHT 400 -#define OFFSET 50 - -static GLFWwindow* windows[2]; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -static GLFWwindow* open_window(const char* title, GLFWwindow* share, int posX, int posY) -{ - GLFWwindow* window; - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - window = glfwCreateWindow(WIDTH, HEIGHT, title, NULL, share); - if (!window) - return NULL; - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - glfwSetWindowPos(window, posX, posY); - glfwShowWindow(window); - - glfwSetKeyCallback(window, key_callback); - - return window; -} - -static GLuint create_texture(void) -{ - int x, y; - char pixels[256 * 256]; - GLuint texture; - - glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_2D, texture); - - for (y = 0; y < 256; y++) - { - for (x = 0; x < 256; x++) - pixels[y * 256 + x] = rand() % 256; - } - - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 256, 256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - return texture; -} - -static void draw_quad(GLuint texture) -{ - int width, height; - glfwGetFramebufferSize(glfwGetCurrentContext(), &width, &height); - - glViewport(0, 0, width, height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.f, 1.f, 0.f, 1.f, 0.f, 1.f); - - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, texture); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - glBegin(GL_QUADS); - - glTexCoord2f(0.f, 0.f); - glVertex2f(0.f, 0.f); - - glTexCoord2f(1.f, 0.f); - glVertex2f(1.f, 0.f); - - glTexCoord2f(1.f, 1.f); - glVertex2f(1.f, 1.f); - - glTexCoord2f(0.f, 1.f); - glVertex2f(0.f, 1.f); - - glEnd(); -} - -int main(int argc, char** argv) -{ - int x, y, width; - GLuint texture; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - windows[0] = open_window("First", NULL, OFFSET, OFFSET); - if (!windows[0]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - // This is the one and only time we create a texture - // It is created inside the first context, created above - // It will then be shared with the second context, created below - texture = create_texture(); - - glfwGetWindowPos(windows[0], &x, &y); - glfwGetWindowSize(windows[0], &width, NULL); - - // Put the second window to the right of the first one - windows[1] = open_window("Second", windows[0], x + width + OFFSET, y); - if (!windows[1]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - // Set drawing color for both contexts - glfwMakeContextCurrent(windows[0]); - glColor3f(0.6f, 0.f, 0.6f); - glfwMakeContextCurrent(windows[1]); - glColor3f(0.6f, 0.6f, 0.f); - - glfwMakeContextCurrent(windows[0]); - - while (!glfwWindowShouldClose(windows[0]) && - !glfwWindowShouldClose(windows[1])) - { - glfwMakeContextCurrent(windows[0]); - draw_quad(texture); - - glfwMakeContextCurrent(windows[1]); - draw_quad(texture); - - glfwSwapBuffers(windows[0]); - glfwSwapBuffers(windows[1]); - - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/tearing.c b/testbed/nanogui/ext/glfw/tests/tearing.c deleted file mode 100644 index 94865fab..00000000 --- a/testbed/nanogui/ext/glfw/tests/tearing.c +++ /dev/null @@ -1,130 +0,0 @@ -//======================================================================== -// Vsync enabling test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test renders a high contrast, horizontally moving bar, allowing for -// visual verification of whether the set swap interval is indeed obeyed -// -//======================================================================== - -#include - -#include -#include -#include - -static int swap_interval; -static double frame_rate; - -static void update_window_title(GLFWwindow* window) -{ - char title[256]; - - sprintf(title, "Tearing detector (interval %i, %0.1f Hz)", - swap_interval, frame_rate); - - glfwSetWindowTitle(window, title); -} - -static void set_swap_interval(GLFWwindow* window, int interval) -{ - swap_interval = interval; - glfwSwapInterval(swap_interval); - update_window_title(window); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) - set_swap_interval(window, 1 - swap_interval); -} - -int main(void) -{ - float position; - unsigned long frame_count = 0; - double last_time, current_time; - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - set_swap_interval(window, 0); - - last_time = glfwGetTime(); - frame_rate = 0.0; - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetKeyCallback(window, key_callback); - - glMatrixMode(GL_PROJECTION); - glOrtho(-1.f, 1.f, -1.f, 1.f, 1.f, -1.f); - glMatrixMode(GL_MODELVIEW); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - position = cosf((float) glfwGetTime() * 4.f) * 0.75f; - glRectf(position - 0.25f, -1.f, position + 0.25f, 1.f); - - glfwSwapBuffers(window); - glfwPollEvents(); - - frame_count++; - - current_time = glfwGetTime(); - if (current_time - last_time > 1.0) - { - frame_rate = frame_count / (current_time - last_time); - frame_count = 0; - last_time = current_time; - update_window_title(window); - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/threads.c b/testbed/nanogui/ext/glfw/tests/threads.c deleted file mode 100644 index 0a385787..00000000 --- a/testbed/nanogui/ext/glfw/tests/threads.c +++ /dev/null @@ -1,135 +0,0 @@ -//======================================================================== -// Multi-threading test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test is intended to verify whether the OpenGL context part of -// the GLFW API is able to be used from multiple threads -// -//======================================================================== - -#include "tinycthread.h" - -#include - -#include -#include -#include - -typedef struct -{ - GLFWwindow* window; - const char* title; - float r, g, b; - thrd_t id; -} Thread; - -static volatile GLboolean running = GL_TRUE; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static int thread_main(void* data) -{ - const Thread* thread = data; - - glfwMakeContextCurrent(thread->window); - glfwSwapInterval(1); - - while (running) - { - const float v = (float) fabs(sin(glfwGetTime() * 2.f)); - glClearColor(thread->r * v, thread->g * v, thread->b * v, 0.f); - - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(thread->window); - } - - glfwMakeContextCurrent(NULL); - return 0; -} - -int main(void) -{ - int i, result; - Thread threads[] = - { - { NULL, "Red", 1.f, 0.f, 0.f, 0 }, - { NULL, "Green", 0.f, 1.f, 0.f, 0 }, - { NULL, "Blue", 0.f, 0.f, 1.f, 0 } - }; - const int count = sizeof(threads) / sizeof(Thread); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - for (i = 0; i < count; i++) - { - threads[i].window = glfwCreateWindow(200, 200, - threads[i].title, - NULL, NULL); - if (!threads[i].window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetWindowPos(threads[i].window, 200 + 250 * i, 200); - glfwShowWindow(threads[i].window); - - if (thrd_create(&threads[i].id, thread_main, threads + i) != - thrd_success) - { - fprintf(stderr, "Failed to create secondary thread\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - } - - while (running) - { - glfwWaitEvents(); - - for (i = 0; i < count; i++) - { - if (glfwWindowShouldClose(threads[i].window)) - running = GL_FALSE; - } - } - - for (i = 0; i < count; i++) - glfwHideWindow(threads[i].window); - - for (i = 0; i < count; i++) - thrd_join(threads[i].id, &result); - - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/title.c b/testbed/nanogui/ext/glfw/tests/title.c deleted file mode 100644 index 15ddb83f..00000000 --- a/testbed/nanogui/ext/glfw/tests/title.c +++ /dev/null @@ -1,76 +0,0 @@ -//======================================================================== -// UTF-8 window title test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test sets a UTF-8 window title -// -//======================================================================== - -#include - -#include -#include - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -int main(void) -{ - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(400, 400, "English 日本語 русский язык 官話", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/nanogui/ext/glfw/tests/windows.c b/testbed/nanogui/ext/glfw/tests/windows.c deleted file mode 100644 index 164a298f..00000000 --- a/testbed/nanogui/ext/glfw/tests/windows.c +++ /dev/null @@ -1,117 +0,0 @@ -//======================================================================== -// Simple multi-window test -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test creates four windows and clears each in a different color -// -//======================================================================== - -#include - -#include -#include - -static const char* titles[4] = -{ - "Foo", - "Bar", - "Baz", - "Quux" -}; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) - { - int xpos, ypos; - glfwGetWindowPos(window, &xpos, &ypos); - glfwSetWindowPos(window, xpos, ypos); - } -} - -int main(void) -{ - int i; - GLboolean running = GL_TRUE; - GLFWwindow* windows[4]; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - for (i = 0; i < 4; i++) - { - int left, top, right, bottom; - - windows[i] = glfwCreateWindow(200, 200, titles[i], NULL, NULL); - if (!windows[i]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(windows[i], key_callback); - - glfwMakeContextCurrent(windows[i]); - glClearColor((GLclampf) (i & 1), - (GLclampf) (i >> 1), - i ? 0.f : 1.f, - 0.f); - - glfwGetWindowFrameSize(windows[i], &left, &top, &right, &bottom); - glfwSetWindowPos(windows[i], - 100 + (i & 1) * (200 + left + right), - 100 + (i >> 1) * (200 + top + bottom)); - } - - for (i = 0; i < 4; i++) - glfwShowWindow(windows[i]); - - while (running) - { - for (i = 0; i < 4; i++) - { - glfwMakeContextCurrent(windows[i]); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(windows[i]); - - if (glfwWindowShouldClose(windows[i])) - running = GL_FALSE; - } - - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/testbed/src/Gui.cpp b/testbed/src/Gui.cpp index 787fabf1..438441b7 100644 --- a/testbed/src/Gui.cpp +++ b/testbed/src/Gui.cpp @@ -33,17 +33,6 @@ using namespace nanogui; //GLFWwindow* Gui::mWindow = NULL; -double Gui::g_Time = 0.0f; -bool Gui::g_MousePressed[3] = {false, false, false}; -float Gui::g_MouseWheel = 0.0f; -GLuint Gui::g_FontTexture = 0; -size_t Gui::g_VboSize = 0; -int Gui::g_AttribLocationTex = 0, Gui::g_AttribLocationProjMtx = 0; -int Gui::g_AttribLocationPosition = 0, Gui::g_AttribLocationUV = 0, Gui::g_AttribLocationColor = 0; -Shader Gui::mShader; -openglframework::VertexBufferObject Gui::mVBO(GL_ARRAY_BUFFER); -openglframework::VertexArrayObject Gui::mVAO; -Gui::LeftPane Gui::mLeftPane = SCENES; double Gui::mScrollX = 0.0; double Gui::mScrollY = 0.0; double Gui::mTimeSinceLastProfilingDisplay = 0; @@ -55,23 +44,11 @@ double Gui::mCachedPhysicsUpdateTime = 0; Gui::Gui(Screen* screen) { mScreen = screen; - - g_Time = 0.0f; - g_MousePressed[0] = false; - g_MousePressed[1] = false; - g_MousePressed[2] = false; - g_MouseWheel = 0.0f; - g_FontTexture = 0; - g_VboSize = 0; } // Destructor Gui::~Gui() { - mVAO.destroy(); - mVBO.destroy(); - - mShader.destroy(); //imguiRenderGLDestroy(); } diff --git a/testbed/src/Gui.h b/testbed/src/Gui.h index 9f625310..4b4d66cb 100644 --- a/testbed/src/Gui.h +++ b/testbed/src/Gui.h @@ -31,11 +31,6 @@ #include #include "openglframework.h" -// Constants -const int LEFT_PANE_WIDTH = 300; -const int LEFT_PANE_HEADER_HEIGHT = 90; -const double TIME_INTERVAL_DISPLAY_PROFILING_INFO = 0.3; -const int CHECKBOX_SIZE = 9; using namespace openglframework; using namespace nanogui; @@ -57,18 +52,6 @@ class Gui { Screen* mScreen; - static Shader mShader; - static double g_Time; - static bool g_MousePressed[3]; - static float g_MouseWheel; - static GLuint g_FontTexture; - static int g_AttribLocationTex, g_AttribLocationProjMtx; - static int g_AttribLocationPosition, g_AttribLocationUV, g_AttribLocationColor; - static size_t g_VboSize; - static openglframework::VertexBufferObject mVBO; - static openglframework::VertexArrayObject mVAO; - static LeftPane mLeftPane; - static double mScrollX, mScrollY; // -------------------- Methods -------------------- // diff --git a/testbed/src/TestbedApplication.h b/testbed/src/TestbedApplication.h index a3b7fc89..117cc31d 100644 --- a/testbed/src/TestbedApplication.h +++ b/testbed/src/TestbedApplication.h @@ -55,8 +55,6 @@ class TestbedApplication : public Screen { bool mIsInitialized; - Screen* mScreen; - Gui mGui; /// Timer