Make file formatting comply with POSIX and Unix standards

UTF-8, LF, no BOM, and newlines at the end of files
This commit is contained in:
Aaron Franke 2020-03-21 21:30:06 -04:00 committed by Rasmus Munk Larsen
parent 5afdaa473a
commit 5c22c7a7de
45 changed files with 3277 additions and 3279 deletions

View File

@ -23,4 +23,4 @@
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 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 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */

View File

@ -1,52 +1,51 @@
Minpack Copyright Notice (1999) University of Chicago. All rights reserved Minpack Copyright Notice (1999) University of Chicago. All rights reserved
Redistribution and use in source and binary forms, with or Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the without modification, are permitted provided that the
following conditions are met: following conditions are met:
1. Redistributions of source code must retain the above 1. Redistributions of source code must retain the above
copyright notice, this list of conditions and the following copyright notice, this list of conditions and the following
disclaimer. disclaimer.
2. Redistributions in binary form must reproduce the above 2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials disclaimer in the documentation and/or other materials
provided with the distribution. provided with the distribution.
3. The end-user documentation included with the 3. The end-user documentation included with the
redistribution, if any, must include the following redistribution, if any, must include the following
acknowledgment: acknowledgment:
"This product includes software developed by the "This product includes software developed by the
University of Chicago, as Operator of Argonne National University of Chicago, as Operator of Argonne National
Laboratory. Laboratory.
Alternately, this acknowledgment may appear in the software Alternately, this acknowledgment may appear in the software
itself, if and wherever such third-party acknowledgments itself, if and wherever such third-party acknowledgments
normally appear. normally appear.
4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" 4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS"
WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE
UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND
THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE
OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY
OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR
USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF
THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4)
DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION
UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL
BE CORRECTED. BE CORRECTED.
5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT 5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT
HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF
ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT,
INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF
ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF
PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER
SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT
(INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,
EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE
POSSIBILITY OF SUCH LOSS OR DAMAGES. POSSIBILITY OF SUCH LOSS OR DAMAGES.

View File

@ -38,4 +38,4 @@
nv.utils.windowResize(chart.update); nv.utils.windowResize(chart.update);
</script> </script>
</body> </body>
</html> </html>

View File

@ -43,4 +43,3 @@
<body> <body>
<svg id='chart'></svg> <svg id='chart'></svg>
<script type='text/javascript'> <script type='text/javascript'>

View File

@ -122,4 +122,4 @@ int main(int argc, char **args)
// std::cout<<x.transpose()<<"\n"; // std::cout<<x.transpose()<<"\n";
return 0; return 0;
} }

View File

@ -90,4 +90,4 @@ int main(int argc, char **args)
cout << "Number of nonzeros in the factor : " << solver.nnzL() + solver.nnzU() << std::endl; cout << "Number of nonzeros in the factor : " << solver.nnzL() + solver.nnzU() << std::endl;
return 0; return 0;
} }

View File

@ -6,4 +6,4 @@ To try this with GCC, do:
gcc example.c binary_library.o -o example -lstdc++ gcc example.c binary_library.o -o example -lstdc++
./example ./example
TODO: add CMakeLists, add more explanations here TODO: add CMakeLists, add more explanations here

View File

@ -68,4 +68,4 @@ extern "C"
#ifdef __cplusplus #ifdef __cplusplus
} // end extern "C" } // end extern "C"
#endif #endif

View File

@ -232,4 +232,4 @@ td.width20em p.endtd {
/* needed for huge screens */ /* needed for huge screens */
.ui-resizable-e { .ui-resizable-e {
background-repeat: repeat-y; background-repeat: repeat-y;
} }

View File

@ -2,4 +2,4 @@ ArrayXXi a {
{1, 2, 3}, {1, 2, 3},
{3, 4, 5} {3, 4, 5}
}; };
cout << a << endl; cout << a << endl;

View File

@ -1,2 +1,2 @@
Array<int, Dynamic, 1> v {{1, 2, 3, 4, 5}}; Array<int, Dynamic, 1> v {{1, 2, 3, 4, 5}};
cout << v << endl; cout << v << endl;

View File

@ -1,3 +1,3 @@
Array<int, 1, 6> a(1, 2, 3, 4, 5, 6); Array<int, 1, 6> a(1, 2, 3, 4, 5, 6);
Array<int, 3, 1> b {1, 2, 3}; Array<int, 3, 1> b {1, 2, 3};
cout << a << "\n\n" << b << endl; cout << a << "\n\n" << b << endl;

View File

@ -8,4 +8,4 @@
std::cout << "#iterations: " << solver.iterations() << std::endl; std::cout << "#iterations: " << solver.iterations() << std::endl;
std::cout << "estimated error: " << solver.error() << std::endl; std::cout << "estimated error: " << solver.error() << std::endl;
/* ... update b ... */ /* ... update b ... */
x = solver.solve(b); // solve again x = solver.solve(b); // solve again

View File

@ -11,4 +11,4 @@
x = solver.solveWithGuess(b,x); x = solver.solveWithGuess(b,x);
std::cout << i << " : " << solver.error() << std::endl; std::cout << i << " : " << solver.error() << std::endl;
++i; ++i;
} while (solver.info()!=Success && i<100); } while (solver.info()!=Success && i<100);

View File

@ -3,4 +3,4 @@ JacobiRotation<float> G;
G.makeGivens(v.x(), v.y()); G.makeGivens(v.x(), v.y());
cout << "Here is the vector v:" << endl << v << endl; cout << "Here is the vector v:" << endl << v << endl;
v.applyOnTheLeft(0, 1, G.adjoint()); v.applyOnTheLeft(0, 1, G.adjoint());
cout << "Here is the vector J' * v:" << endl << v << endl; cout << "Here is the vector J' * v:" << endl << v << endl;

View File

@ -5,4 +5,4 @@ J.makeJacobi(m, 0, 1);
cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the matrix m:" << endl << m << endl;
m.applyOnTheLeft(0, 1, J.adjoint()); m.applyOnTheLeft(0, 1, J.adjoint());
m.applyOnTheRight(0, 1, J); m.applyOnTheRight(0, 1, J);
cout << "Here is the matrix J' * m * J:" << endl << m << endl; cout << "Here is the matrix J' * m * J:" << endl << m << endl;

View File

@ -2,4 +2,4 @@ int data[] = {1,2,3,4,5,6,7,8,9};
Map<RowVectorXi> v(data,4); Map<RowVectorXi> v(data,4);
cout << "The mapped vector v is: " << v << "\n"; cout << "The mapped vector v is: " << v << "\n";
new (&v) Map<RowVectorXi>(data+4,5); new (&v) Map<RowVectorXi>(data+4,5);
cout << "Now v is: " << v << "\n"; cout << "Now v is: " << v << "\n";

View File

@ -9,4 +9,4 @@ cout << "Here is the matrix m after the for-range-loop:" << endl << m << endl;
auto cols = m.colwise(); auto cols = m.colwise();
auto it = std::find_if(cols.cbegin(), cols.cend(), auto it = std::find_if(cols.cbegin(), cols.cend(),
[](Matrix3i::ConstColXpr x) { return x.squaredNorm() == 0; }); [](Matrix3i::ConstColXpr x) { return x.squaredNorm() == 0; });
cout << "The first empty column is: " << distance(cols.cbegin(),it) << endl; cout << "The first empty column is: " << distance(cols.cbegin(),it) << endl;

View File

@ -3,4 +3,4 @@ Projective3d P(Matrix4d::Random());
cout << "v = " << v.transpose() << "]^T" << endl; cout << "v = " << v.transpose() << "]^T" << endl;
cout << "v.hnormalized() = " << v.hnormalized().transpose() << "]^T" << endl; cout << "v.hnormalized() = " << v.hnormalized().transpose() << "]^T" << endl;
cout << "P*v = " << (P*v).transpose() << "]^T" << endl; cout << "P*v = " << (P*v).transpose() << "]^T" << endl;
cout << "(P*v).hnormalized() = " << (P*v).hnormalized().transpose() << "]^T" << endl; cout << "(P*v).hnormalized() = " << (P*v).hnormalized().transpose() << "]^T" << endl;

View File

@ -3,4 +3,4 @@ Projective3d P(Matrix4d::Random());
cout << "v = [" << v.transpose() << "]^T" << endl; cout << "v = [" << v.transpose() << "]^T" << endl;
cout << "h.homogeneous() = [" << v.homogeneous().transpose() << "]^T" << endl; cout << "h.homogeneous() = [" << v.homogeneous().transpose() << "]^T" << endl;
cout << "(P * v.homogeneous()) = [" << (P * v.homogeneous()).transpose() << "]^T" << endl; cout << "(P * v.homogeneous()) = [" << (P * v.homogeneous()).transpose() << "]^T" << endl;
cout << "(P * v.homogeneous()).hnormalized() = [" << (P * v.homogeneous()).eval().hnormalized().transpose() << "]^T" << endl; cout << "(P * v.homogeneous()).hnormalized() = [" << (P * v.homogeneous()).eval().hnormalized().transpose() << "]^T" << endl;

View File

@ -2,4 +2,4 @@ MatrixXd m {
{1, 2, 3}, {1, 2, 3},
{4, 5, 6} {4, 5, 6}
}; };
cout << m << endl; cout << m << endl;

View File

@ -1,2 +1,2 @@
VectorXi v {{1, 2}}; VectorXi v {{1, 2}};
cout << v << endl; cout << v << endl;

View File

@ -1,3 +1,3 @@
Matrix<int, 1, 6> a(1, 2, 3, 4, 5, 6); Matrix<int, 1, 6> a(1, 2, 3, 4, 5, 6);
Matrix<int, 3, 1> b {1, 2, 3}; Matrix<int, 3, 1> b {1, 2, 3};
cout << a << "\n\n" << b << endl; cout << a << "\n\n" << b << endl;

View File

@ -1,4 +1,4 @@
ArrayXi ind(5); ind<<4,2,5,5,3; ArrayXi ind(5); ind<<4,2,5,5,3;
MatrixXi A = MatrixXi::Random(4,6); MatrixXi A = MatrixXi::Random(4,6);
cout << "Initial matrix A:\n" << A << "\n\n"; cout << "Initial matrix A:\n" << A << "\n\n";
cout << "A(all,ind-1):\n" << A(all,ind-1) << "\n\n"; cout << "A(all,ind-1):\n" << A(all,ind-1) << "\n\n";

View File

@ -9,4 +9,4 @@ A.reshaped() = VectorXi::LinSpaced(9,1,9);
cout << "Initial matrix A:\n" << A << "\n\n"; cout << "Initial matrix A:\n" << A << "\n\n";
MatrixXi B(5,5); MatrixXi B(5,5);
B = A(pad{3,5}, pad{3,5}); B = A(pad{3,5}, pad{3,5});
cout << "A(pad{3,N}, pad{3,N}):\n" << B << "\n\n"; cout << "A(pad{3,N}, pad{3,N}):\n" << B << "\n\n";

View File

@ -2,4 +2,4 @@
MatrixXi A = MatrixXi::Random(4,6); MatrixXi A = MatrixXi::Random(4,6);
cout << "Initial matrix A:\n" << A << "\n\n"; cout << "Initial matrix A:\n" << A << "\n\n";
cout << "A(all,{4,2,5,5,3}):\n" << A(all,{4,2,5,5,3}) << "\n\n"; cout << "A(all,{4,2,5,5,3}):\n" << A(all,{4,2,5,5,3}) << "\n\n";
#endif #endif

View File

@ -1,4 +1,4 @@
std::vector<int> ind{4,2,5,5,3}; std::vector<int> ind{4,2,5,5,3};
MatrixXi A = MatrixXi::Random(4,6); MatrixXi A = MatrixXi::Random(4,6);
cout << "Initial matrix A:\n" << A << "\n\n"; cout << "Initial matrix A:\n" << A << "\n\n";
cout << "A(all,ind):\n" << A(all,ind) << "\n\n"; cout << "A(all,ind):\n" << A(all,ind) << "\n\n";

View File

@ -2,4 +2,4 @@ MatrixXf A(2,2), B(3,2);
B << 2, 0, 0, 3, 1, 1; B << 2, 0, 0, 3, 1, 1;
A << 2, 0, 0, -2; A << 2, 0, 0, -2;
A = (B * A).cwiseAbs(); A = (B * A).cwiseAbs();
cout << A; cout << A;

View File

@ -3,4 +3,4 @@ M1 << 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12; 7, 8, 9, 10, 11, 12;
Map<MatrixXf> M2(M1.data(), 6,2); Map<MatrixXf> M2(M1.data(), 6,2);
cout << "M2:" << endl << M2 << endl; cout << "M2:" << endl << M2 << endl;

View File

@ -8,4 +8,4 @@ cout << "v1:" << endl << v1 << endl;
Matrix<float,Dynamic,Dynamic,RowMajor> M2(M1); Matrix<float,Dynamic,Dynamic,RowMajor> M2(M1);
Map<RowVectorXf> v2(M2.data(), M2.size()); Map<RowVectorXf> v2(M2.data(), M2.size());
cout << "v2:" << endl << v2 << endl; cout << "v2:" << endl << v2 << endl;

View File

@ -8,4 +8,4 @@ RowMajorMatrixXf M3(M1);
cout << "Row major input:" << endl << M3 << "\n"; cout << "Row major input:" << endl << M3 << "\n";
Map<RowMajorMatrixXf,0,Stride<Dynamic,3> > M4(M3.data(), M3.rows(), (M3.cols()+2)/3, Map<RowMajorMatrixXf,0,Stride<Dynamic,3> > M4(M3.data(), M3.rows(), (M3.cols()+2)/3,
Stride<Dynamic,3>(M3.outerStride(),3)); Stride<Dynamic,3>(M3.outerStride(),3));
cout << "1 column over 3:" << endl << M4 << "\n"; cout << "1 column over 3:" << endl << M4 << "\n";

View File

@ -1,4 +1,4 @@
RowVectorXf v = RowVectorXf::LinSpaced(20,0,19); RowVectorXf v = RowVectorXf::LinSpaced(20,0,19);
cout << "Input:" << endl << v << endl; cout << "Input:" << endl << v << endl;
Map<RowVectorXf,0,InnerStride<2> > v2(v.data(), v.size()/2); Map<RowVectorXf,0,InnerStride<2> > v2(v.data(), v.size()/2);
cout << "Even:" << v2 << endl; cout << "Even:" << v2 << endl;

View File

@ -1,4 +1,4 @@
VectorXi v = VectorXi::Random(4); VectorXi v = VectorXi::Random(4);
cout << "Here is the vector v:\n"; cout << "Here is the vector v:\n";
for(auto x : v) cout << x << " "; for(auto x : v) cout << x << " ";
cout << "\n"; cout << "\n";

View File

@ -2,4 +2,4 @@ Matrix2i A = Matrix2i::Random();
cout << "Here are the coeffs of the 2x2 matrix A:\n"; cout << "Here are the coeffs of the 2x2 matrix A:\n";
for(auto x : A.reshaped()) for(auto x : A.reshaped())
cout << x << " "; cout << x << " ";
cout << "\n"; cout << "\n";

View File

@ -2,4 +2,4 @@ MatrixXi m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.reshaped(2, 8):" << endl << m.reshaped(2, 8) << endl; cout << "Here is m.reshaped(2, 8):" << endl << m.reshaped(2, 8) << endl;
m.resize(2,8); m.resize(2,8);
cout << "Here is the matrix m after m.resize(2,8):" << endl << m << endl; cout << "Here is the matrix m after m.resize(2,8):" << endl << m << endl;

View File

@ -1,4 +1,4 @@
Array4i v = Array4i::Random().abs(); Array4i v = Array4i::Random().abs();
cout << "Here is the initial vector v:\n" << v.transpose() << "\n"; cout << "Here is the initial vector v:\n" << v.transpose() << "\n";
std::sort(v.begin(), v.end()); std::sort(v.begin(), v.end());
cout << "Here is the sorted vector v:\n" << v.transpose() << "\n"; cout << "Here is the sorted vector v:\n" << v.transpose() << "\n";

View File

@ -2,4 +2,4 @@ ArrayXXi A = ArrayXXi::Random(4,4).abs();
cout << "Here is the initial matrix A:\n" << A << "\n"; cout << "Here is the initial matrix A:\n" << A << "\n";
for(auto row : A.rowwise()) for(auto row : A.rowwise())
std::sort(row.begin(), row.end()); std::sort(row.begin(), row.end());
cout << "Here is the sorted matrix A:\n" << A << "\n"; cout << "Here is the sorted matrix A:\n" << A << "\n";

View File

@ -2,4 +2,4 @@ Matrix2i a; a << 1, 2, 3, 4;
cout << "Here is the matrix a:\n" << a << endl; cout << "Here is the matrix a:\n" << a << endl;
a = a.transpose(); // !!! do NOT do this !!! a = a.transpose(); // !!! do NOT do this !!!
cout << "and the result of the aliasing effect:\n" << a << endl; cout << "and the result of the aliasing effect:\n" << a << endl;

View File

@ -3,4 +3,4 @@ cout << "Here is the initial matrix a:\n" << a << endl;
a.transposeInPlace(); a.transposeInPlace();
cout << "and after being transposed:\n" << a << endl; cout << "and after being transposed:\n" << a << endl;

View File

@ -11,4 +11,4 @@ int main()
#else #else
b.swap(ac.const_cast_derived()); b.swap(ac.const_cast_derived());
#endif #endif
} }

View File

@ -382,4 +382,4 @@ EIGEN_DECLARE_TEST(initializer_list_construction)
CALL_SUBTEST_6(dynamicVectorConstruction<std::ptrdiff_t>()); CALL_SUBTEST_6(dynamicVectorConstruction<std::ptrdiff_t>());
CALL_SUBTEST_6(dynamicVectorConstruction<std::complex<double>>()); CALL_SUBTEST_6(dynamicVectorConstruction<std::complex<double>>());
CALL_SUBTEST_6(dynamicVectorConstruction<std::complex<float>>()); CALL_SUBTEST_6(dynamicVectorConstruction<std::complex<float>>());
} }

View File

@ -60,4 +60,4 @@ int main()
} }
} }
printf("c=a*b Done\n"); printf("c=a*b Done\n");
} }

View File

@ -434,4 +434,4 @@ EIGEN_DECLARE_TEST(cxx11_tensor_block_io) {
CALL_SUBTEST(test_block_io_squeeze_ones<RowMajor>()); CALL_SUBTEST(test_block_io_squeeze_ones<RowMajor>());
CALL_SUBTEST(test_block_io_squeeze_ones<ColMajor>()); CALL_SUBTEST(test_block_io_squeeze_ones<ColMajor>());
// clang-format on // clang-format on
} }

View File

@ -169,4 +169,4 @@ EIGEN_DECLARE_TEST(cxx11_tensor_trace) {
CALL_SUBTEST(test_simple_trace<RowMajor>()); CALL_SUBTEST(test_simple_trace<RowMajor>());
CALL_SUBTEST(test_trace_in_expr<ColMajor>()); CALL_SUBTEST(test_trace_in_expr<ColMajor>());
CALL_SUBTEST(test_trace_in_expr<RowMajor>()); CALL_SUBTEST(test_trace_in_expr<RowMajor>());
} }

File diff suppressed because it is too large Load Diff