https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
Eigen Namespace Reference

Namespaces

namespace  internal
 

Classes

struct  NumTraits< MetaPhysicL::DualNumber< V, D, asd > >
 
struct  ScalarBinaryOpTraits< MetaPhysicL::DualNumber< V, D, asd >, Real, BinaryOp >
 
struct  ScalarBinaryOpTraits< Real, MetaPhysicL::DualNumber< V, D, asd >, BinaryOp >
 

Functions

template<typename Scalar , int Rows, int Cols, int Options, int MaxRows, int MaxCols>
void to_json (nlohmann::json &json, const Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &matrix)
 

Function Documentation

◆ to_json()

template<typename Scalar , int Rows, int Cols, int Options, int MaxRows, int MaxCols>
void Eigen::to_json ( nlohmann::json &  json,
const Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &  matrix 
)

Definition at line 141 of file JsonIO.h.

142{
143 if constexpr (Rows == 1 || Cols == 1)
144 {
145 std::vector<Scalar> values(matrix.data(), matrix.data() + matrix.rows() * matrix.cols());
146 nlohmann::to_json(json, values);
147 }
148 else
149 {
150 const auto nrows = matrix.rows();
151 const auto ncols = matrix.cols();
152 std::vector<std::vector<Scalar>> values(nrows, std::vector<Scalar>(ncols));
153 for (const auto i : make_range(nrows))
154 for (const auto j : make_range(ncols))
155 values[i][j] = matrix(i, j);
156 nlohmann::to_json(json, values);
157 }
158}
std::array< Real, 2 > values
Definition MortarUtils.C:52
for(PetscInt i=0;i< nvars;++i)