Braced initialization, migration to C++14

0 views
Skip to first unread message

Juan Jose Garcia-Ripoll

unread,
Jan 26, 2022, 5:36:55 AM1/26/22
to libt...@googlegroups.com, Ulf Lorenz
The branch cmake now builds fine using CMake under Windows (with MSVC and vcpkg), Debian and Ubuntu.

I am continuing to work on this branch, making improvements and upgrades on the C++ front, moving from C++98 to C++14, improving legibility and adding a few new features.

For example, tensors can now be initialized using braced lists, as in
RTensor A = {{1, 2}, {3, 4}};
This syntax follows the C order, where {1,2} and {3,4} are the rows of the matrix, even if they are stored in Fortran order internally.

The library now also works with lambda functions, which are supported by the iterative solvers such as eigs() or cgs().

Adding some of these features mean incompatible changes. To avoid ambiguity when using initalizer lists, the constructors Tensor(n), Tensor(n,m), etc, are no longer supported and you should use instead Tensor::empty(d1, ... dn) for empty tensors with fixed dimensions.

I hope these changes are not too disruptive.

Best,

--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain) 
http://juanjose.garciaripoll.googlepages.com
Reply all
Reply to author
Forward
0 new messages