Reaktoro
A unified framework for modeling chemically reactive systems
Matrix.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2018 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // Eigen includes
21 #include <Reaktoro/deps/eigen3/Eigen/Core>
22 
23 // Reaktoro includes
24 #include <Reaktoro/Common/Index.hpp>
25 
26 namespace Reaktoro {
27 
28 using Vector = Eigen::VectorXd;
29 using VectorRef = Eigen::Ref<Eigen::VectorXd>;
30 using VectorStridedRef = Eigen::Ref<Vector, 0, Eigen::InnerStride<>>;
31 using VectorConstRef = Eigen::Ref<const Eigen::VectorXd>;
32 using VectorMap = Eigen::Map<Eigen::VectorXd>;
33 using VectorConstMap = Eigen::Map<const Eigen::VectorXd>;
34 
35 using RowVector = Eigen::RowVectorXd;
36 using RowVectorRef = Eigen::Ref<Eigen::RowVectorXd>;
37 using RowVectorStridedRef = Eigen::Ref<Eigen::RowVectorXd, 0, Eigen::InnerStride<>>;
38 using RowVectorConstRef = Eigen::Ref<const Eigen::RowVectorXd>;
39 using RowVectorMap = Eigen::Map<Eigen::RowVectorXd>;
40 using RowVectorConstMap = Eigen::Map<const Eigen::RowVectorXd>;
41 
42 using Matrix = Eigen::MatrixXd;
43 using MatrixRef = Eigen::Ref<Eigen::MatrixXd>;
44 using MatrixConstRef = Eigen::Ref<const Eigen::MatrixXd>;
45 using MatrixMap = Eigen::Map<Eigen::MatrixXd>;
46 using MatrixConstMap = Eigen::Map<const Eigen::MatrixXd>;
47 
48 using Vector = Eigen::VectorXd;
49 using VectorXd = Eigen::VectorXd;
50 using VectorXi = Eigen::VectorXi;
51 
52 using VectorRef = Eigen::Ref<VectorXd>;
53 using VectorXdRef = Eigen::Ref<VectorXd>;
54 using VectorXiRef = Eigen::Ref<VectorXi>;
55 
56 using VectorConstRef = Eigen::Ref<const VectorXd>;
57 using VectorXdConstRef = Eigen::Ref<const VectorXd>;
58 using VectorXiConstRef = Eigen::Ref<const VectorXi>;
59 
60 using VectorMap = Eigen::Map<VectorXd>;
61 using VectorXdMap = Eigen::Map<VectorXd>;
62 using VectorXiMap = Eigen::Map<VectorXi>;
63 
64 using VectorConstMap = Eigen::Map<const VectorXd>;
65 using VectorXdConstMap = Eigen::Map<const VectorXd>;
66 using VectorXiConstMap = Eigen::Map<const VectorXi>;
67 
68 using Matrix = Eigen::MatrixXd;
69 using MatrixXd = Eigen::MatrixXd;
70 using MatrixXi = Eigen::MatrixXi;
71 
72 using MatrixRef = Eigen::Ref<MatrixXd>;
73 using MatrixXdRef = Eigen::Ref<MatrixXd>;
74 using MatrixXiRef = Eigen::Ref<MatrixXi>;
75 
76 using MatrixConstRef = Eigen::Ref<const MatrixXd>;
77 using MatrixXdConstRef = Eigen::Ref<const MatrixXd>;
78 using MatrixXiConstRef = Eigen::Ref<const MatrixXi>;
79 
80 using MatrixMap = Eigen::Map<MatrixXd>;
81 using MatrixXdMap = Eigen::Map<MatrixXd>;
82 using MatrixXiMap = Eigen::Map<MatrixXi>;
83 
84 using MatrixConstMap = Eigen::Map<const MatrixXd>;
85 using MatrixXdConstMap = Eigen::Map<const MatrixXd>;
86 using MatrixXiConstMap = Eigen::Map<const MatrixXi>;
87 
89 using PermutationMatrix = Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic>;
90 
94 auto zeros(Index rows) -> decltype(Vector::Zero(rows));
95 
99 auto ones(Index rows) -> decltype(Vector::Ones(rows));
100 
104 auto random(Index rows) -> decltype(Vector::Random(rows));
105 
111 auto linspace(Index rows, double start, double stop) -> decltype(Vector::LinSpaced(rows, start, stop));
112 
117 auto unit(Index rows, Index i) -> decltype(Vector::Unit(rows, i));
118 
123 auto zeros(Index rows, Index cols) -> decltype(Matrix::Zero(rows, cols));
124 
129 auto ones(Index rows, Index cols) -> decltype(Matrix::Ones(rows, cols));
130 
135 auto random(Index rows, Index cols) -> decltype(Matrix::Random(rows, cols));
136 
141 auto identity(Index rows, Index cols) -> decltype(Matrix::Identity(rows, cols));
142 
146 template<typename Derived>
147 auto rows(Eigen::MatrixBase<Derived>& mat, Index start, Index num) -> decltype(mat.middleRows(start, num));
148 
152 template<typename Derived>
153 auto rows(const Eigen::MatrixBase<Derived>& mat, Index start, Index num) -> decltype(mat.middleRows(start, num));
154 
158 template<typename Derived, typename Indices>
159 auto rows(Eigen::MatrixBase<Derived>& mat, const Indices& irows) -> decltype(mat(irows, Eigen::all));
160 
164 template<typename Derived, typename Indices>
165 auto rows(const Eigen::MatrixBase<Derived>& mat, const Indices& irows) -> decltype(mat(irows, Eigen::all));
166 
170 template<typename Derived>
171 auto cols(Eigen::MatrixBase<Derived>& mat, Index start, Index num) -> decltype(mat.middleCols(start, num));
172 
176 template<typename Derived>
177 auto cols(const Eigen::MatrixBase<Derived>& mat, Index start, Index num) -> decltype(mat.middleCols(start, num));
178 
182 template<typename Derived, typename Indices>
183 auto cols(Eigen::MatrixBase<Derived>& mat, const Indices& icols) -> decltype(mat(Eigen::all, icols));
184 
188 template<typename Derived, typename Indices>
189 auto cols(const Eigen::MatrixBase<Derived>& mat, const Indices& icols) -> decltype(mat(Eigen::all, icols));
190 
195 template<typename Derived>
196 auto segment(Eigen::MatrixBase<Derived>& vec, Index irow, Index nrows) -> decltype(vec.segment(irow, nrows));
197 
202 template<typename Derived>
203 auto segment(const Eigen::MatrixBase<Derived>& vec, Index irow, Index nrows) -> decltype(vec.segment(irow, nrows));
204 
209 template<typename Derived>
210 auto block(Eigen::MatrixBase<Derived>& mat, Index irow, Index icol, Index nrows, Index ncols) -> decltype(mat.block(irow, icol, nrows, ncols));
211 
216 template<typename Derived>
217 auto block(const Eigen::MatrixBase<Derived>& mat, Index irow, Index icol, Index nrows, Index ncols) -> decltype(mat.block(irow, icol, nrows, ncols));
218 
223 template<typename Derived, typename Indices>
224 auto submatrix(Eigen::MatrixBase<Derived>& mat, const Indices& irows, const Indices& icols) -> decltype(mat(irows, icols));
225 
230 template<typename Derived, typename Indices>
231 auto submatrix(const Eigen::MatrixBase<Derived>& mat, const Indices& irows, const Indices& icols) -> decltype(mat(irows, icols));
232 
239 template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
240 auto blockmap(Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>& mat, Index row, Index col, Index nrows, Index ncols) -> Eigen::Map<Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>, Eigen::Unaligned, Eigen::Stride<Rows,Cols>>
241 {
242  Eigen::Stride<Rows,Cols> stride(mat.outerStride(), mat.innerStride());
243  return Eigen::Map<Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>, Eigen::Unaligned, Eigen::Stride<MaxRows,MaxCols>>(
244  mat.block(row, col, nrows, ncols).data(), nrows, ncols, stride);
245 }
246 
253 template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
254 auto blockmap(const Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>& mat, Index row, Index col, Index nrows, Index ncols) -> Eigen::Map<const Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>, Eigen::Unaligned, Eigen::Stride<Rows,Cols>>
255 {
256  Eigen::Stride<Rows,Cols> stride(mat.outerStride(), mat.innerStride());
257  return Eigen::Map<const Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>, Eigen::Unaligned, Eigen::Stride<MaxRows,MaxCols>>(
258  mat.block(row, col, nrows, ncols).data(), nrows, ncols, stride);
259 }
260 
265 template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
266 auto rowsmap(Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>& mat, Index row, Index nrows) -> Eigen::Map<Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>, Eigen::Unaligned, Eigen::Stride<Rows,Cols>>
267 {
268  return blockmap(mat, row, 0, nrows, mat.cols());
269 }
270 
275 template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
276 auto rowsmap(const Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>& mat, Index row, Index nrows) -> Eigen::Map<const Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>, Eigen::Unaligned, Eigen::Stride<Rows,Cols>>
277 {
278  return blockmap(mat, row, 0, nrows, mat.cols());
279 }
280 
287 template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
288 auto colsmap(Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>& mat, Index col, Index ncols) -> Eigen::Map<Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>, Eigen::Unaligned, Eigen::Stride<Rows,Cols>>
289 {
290  return blockmap(mat, 0, col, mat.rows(), ncols);
291 }
292 
299 template<typename Scalar, int Rows, int Cols, int Options, int MaxRows, int MaxCols>
300 auto colsmap(const Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>& mat, Index col, Index ncols) -> Eigen::Map<const Eigen::Matrix<Scalar,Rows,Cols,Options,MaxRows,MaxCols>, Eigen::Unaligned, Eigen::Stride<Rows,Cols>>
301 {
302  return blockmap(mat, 0, col, mat.rows(), ncols);
303 }
304 
306 template<typename Derived>
307 auto tr(Eigen::MatrixBase<Derived>& mat) -> decltype(mat.transpose());
308 
310 template<typename Derived>
311 auto tr(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.transpose());
312 
314 template<typename Derived>
315 auto inv(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.cwiseInverse());
316 
318 template<typename Derived>
319 auto diag(const Eigen::MatrixBase<Derived>& vec) -> decltype(vec.asDiagonal());
320 
322 template<typename Derived>
323 auto diagonal(Eigen::MatrixBase<Derived>& mat) -> decltype(mat.diagonal());
324 
326 template<typename Derived>
327 auto diagonal(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.diagonal());
328 
330 template<int p, typename Derived>
331 auto norm(const Eigen::MatrixBase<Derived>& mat) -> double;
332 
334 template<typename Derived>
335 auto norm(const Eigen::MatrixBase<Derived>& mat) -> double;
336 
338 template<typename Derived>
339 auto norminf(const Eigen::MatrixBase<Derived>& mat) -> double;
340 
342 template<typename Derived>
343 auto sum(const Eigen::DenseBase<Derived>& mat) -> typename Derived::Scalar;
344 
346 template<typename DerivedLHS, typename DerivedRHS>
347 auto dot(const Eigen::MatrixBase<DerivedLHS>& lhs, const Eigen::MatrixBase<DerivedRHS>& rhs) -> decltype(lhs.dot(rhs));
348 
350 template<typename Derived>
351 auto min(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.minCoeff());
352 
354 template<typename DerivedLHS, typename DerivedRHS>
355 auto min(const Eigen::MatrixBase<DerivedLHS>& lhs, const Eigen::MatrixBase<DerivedRHS>& rhs) -> decltype(lhs.cwiseMin(rhs));
356 
358 template<typename Derived>
359 auto max(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.maxCoeff());
360 
362 template<typename DerivedLHS, typename DerivedRHS>
363 auto max(const Eigen::MatrixBase<DerivedLHS>& lhs, const Eigen::MatrixBase<DerivedRHS>& rhs) -> decltype(lhs.cwiseMax(rhs));
364 
366 template<typename DerivedLHS, typename DerivedRHS>
367 auto operator%(const Eigen::MatrixBase<DerivedLHS>& lhs, const Eigen::MatrixBase<DerivedRHS>& rhs) -> decltype(lhs.cwiseProduct(rhs));
368 
370 template<typename DerivedLHS, typename DerivedRHS>
371 auto operator/(const Eigen::MatrixBase<DerivedLHS>& lhs, const Eigen::MatrixBase<DerivedRHS>& rhs) -> decltype(lhs.cwiseQuotient(rhs));
372 
374 template<typename Derived>
375 auto operator/(const typename Derived::Scalar& scalar, const Eigen::MatrixBase<Derived>& mat) -> decltype(scalar*mat.cwiseInverse());
376 
378 template<typename Derived>
379 auto operator+(const typename Derived::Scalar& scalar, const Eigen::MatrixBase<Derived>& mat) -> decltype((scalar + mat.array()).matrix());
380 
382 template<typename Derived>
383 auto operator+(const Eigen::MatrixBase<Derived>& mat, const typename Derived::Scalar& scalar) -> decltype((scalar + mat.array()).matrix());
384 
386 template<typename Derived>
387 auto operator-(const typename Derived::Scalar& scalar, const Eigen::MatrixBase<Derived>& mat) -> decltype((scalar - mat.array()).matrix());
388 
390 template<typename Derived>
391 auto operator-(const Eigen::MatrixBase<Derived>& mat, const typename Derived::Scalar& scalar) -> decltype((mat.array() - scalar).matrix());
392 
394 template<typename Derived>
395 auto abs(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.cwiseAbs());
396 
398 template<typename Derived>
399 auto sqrt(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.cwiseSqrt());
400 
402 template<typename Derived>
403 auto pow(const Eigen::MatrixBase<Derived>& mat, double power) -> decltype(mat.array().pow(power));
404 
406 template<typename Derived>
407 auto exp(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.array().exp().matrix());
408 
410 template<typename Derived>
411 auto log(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.array().log().matrix());
412 
414 template<typename Derived>
415 auto log10(const Eigen::MatrixBase<Derived>& mat) -> decltype(mat.array().log10().matrix());
416 
417 } // namespace Reaktoro
418 
419 #include "Matrix.hxx"
Eigen::MatrixXi MatrixXi
Alias to Eigen type Eigen::MatrixXd.
Definition: Matrix.hpp:70
auto rowsmap(Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &mat, Index row, Index nrows) -> Eigen::Map< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols >, Eigen::Unaligned, Eigen::Stride< Rows, Cols >>
Return a mapped view of a sequence of rows of a matrix.
Definition: Matrix.hpp:266
Eigen::Ref< Eigen::MatrixXd > MatrixRef
Alias to Eigen type Ref<MatrixXd>.
Definition: Matrix.hpp:43
auto random(Index rows) -> decltype(Vector::Random(rows))
Return an expression of a vector with random entries.
Definition: Matrix.hxx:37
Eigen::Ref< MatrixXd > MatrixXdRef
Alias to Eigen type Eigen::Ref<MatrixXd>.
Definition: Matrix.hpp:73
Eigen::Map< MatrixXd > MatrixXdMap
Alias to Eigen type Eigen::Map<MatrixXd>.
Definition: Matrix.hpp:81
auto inv(const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.cwiseInverse())
Return the component-wise inverse of the matrix.
Definition: Matrix.hxx:179
Eigen::Ref< VectorXi > VectorXiRef
Alias to Eigen type Eigen::Ref<VectorXi>.
Definition: Matrix.hpp:54
Eigen::Map< Eigen::MatrixXd > MatrixMap
Alias to Eigen type Map<MatrixXd>.
Definition: Matrix.hpp:45
Eigen::Ref< const VectorXi > VectorXiConstRef
Alias to Eigen type Eigen::Ref<const VectorXi>.
Definition: Matrix.hpp:58
auto norminf(const Eigen::MatrixBase< Derived > &mat) -> double
Return the L-inf norm of a matrix.
Definition: Matrix.hxx:215
auto submatrix(Eigen::MatrixBase< Derived > &mat, const Indices &irows, const Indices &icols) -> decltype(mat(irows, icols))
Return a view of some rows and columns of a matrix.
Definition: Matrix.hxx:155
Eigen::Ref< const MatrixXi > MatrixXiConstRef
Alias to Eigen type Eigen::Ref<const MatrixXi>.
Definition: Matrix.hpp:78
Eigen::Map< const Eigen::VectorXd > VectorConstMap
< Alias to Eigen type Map<VectorXd>.
Definition: Matrix.hpp:33
auto row(ChemicalVectorBase< V, T, P, N > &vec, Index irow) -> ChemicalScalarBase< decltype(vec.val[irow]), decltype(vec.ddn.row(irow))>
Return a ChemicalScalarBase with reference to the chemical scalar in a given row.
Definition: ChemicalVector.hpp:652
Eigen::Map< MatrixXi > MatrixXiMap
Alias to Eigen type Eigen::Map<MatrixXi>.
Definition: Matrix.hpp:82
auto norm(const Eigen::MatrixBase< Derived > &mat) -> double
Return the Lp norm of a matrix.
Definition: Matrix.hxx:203
Eigen::RowVectorXd RowVector
< Alias to Eigen type Map<const VectorXd>.
Definition: Matrix.hpp:35
Eigen::Map< VectorXi > VectorXiMap
Alias to Eigen type Eigen::Map<VectorXi>.
Definition: Matrix.hpp:62
Eigen::Ref< const Eigen::RowVectorXd > RowVectorConstRef
< Alias to Eigen type Ref<RowVectorXd>.
Definition: Matrix.hpp:38
Eigen::MatrixXd MatrixXd
Alias to Eigen type Eigen::MatrixXd.
Definition: Matrix.hpp:69
Eigen::Map< const Eigen::MatrixXd > MatrixConstMap
Alias to Eigen type Map<const MatrixXd>.
Definition: Matrix.hpp:46
auto colsmap(Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &mat, Index col, Index ncols) -> Eigen::Map< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols >, Eigen::Unaligned, Eigen::Stride< Rows, Cols >>
Return a mapped view of a sequence of columns of a matrix.
Definition: Matrix.hpp:288
auto linspace(Index rows, double start, double stop) -> decltype(Vector::LinSpaced(rows, start, stop))
Return a linearly spaced vector.
Definition: Matrix.hxx:42
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto identity(Index rows, Index cols) -> decltype(Matrix::Identity(rows, cols))
Return an expression of an identity matrix.
Definition: Matrix.hxx:77
auto segment(Eigen::MatrixBase< Derived > &vec, Index irow, Index nrows) -> decltype(vec.segment(irow, nrows))
Return a view of some rows and columns of a matrix.
Definition: Matrix.hxx:131
auto zeros(const ChemicalVectorBase< V, T, P, N > &v) -> ChemicalVectorBase< decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0, 0))>
Return a ChemicalVectorBase expression representing zeros with same dimension of given vector.
Definition: ChemicalVector.hpp:361
Eigen::Ref< Eigen::RowVectorXd > RowVectorRef
< Alias to Eigen type RowVectorXd.
Definition: Matrix.hpp:36
auto rows(ChemicalVectorBase< V, T, P, N > &vec, Index irow, Index nrows) -> ChemicalVectorBase< decltype(rows(vec.val, irow, nrows)), decltype(rows(vec.ddT, irow, nrows)), decltype(rows(vec.ddP, irow, nrows)), decltype(rows(vec.ddn, irow, nrows))>
Return a reference of a sequence of rows of this ChemicalVectorBase instance.
Definition: ChemicalVector.hpp:680
auto blockmap(Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &mat, Index row, Index col, Index nrows, Index ncols) -> Eigen::Map< Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols >, Eigen::Unaligned, Eigen::Stride< Rows, Cols >>
Return a block mapped view of a matrix.
Definition: Matrix.hpp:240
Eigen::Map< VectorXd > VectorXdMap
Alias to Eigen type Eigen::Map<VectorXd>.
Definition: Matrix.hpp:61
Eigen::Ref< Eigen::RowVectorXd, 0, Eigen::InnerStride<> > RowVectorStridedRef
< Alias to Eigen type Ref<RowVectorXd>.
Definition: Matrix.hpp:37
Eigen::Map< const Eigen::RowVectorXd > RowVectorConstMap
< Alias to Eigen type Map<VectorXd>.
Definition: Matrix.hpp:40
Eigen::VectorXi VectorXi
Alias to Eigen type Eigen::VectorXd.
Definition: Matrix.hpp:50
auto cols(Eigen::MatrixBase< Derived > &mat, Index start, Index num) -> decltype(mat.middleCols(start, num))
Return a view of a sequence of columns of a matrix.
Definition: Matrix.hxx:107
std::size_t Index
Define a type that represents an index.
Definition: Index.hpp:26
Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic > PermutationMatrix
Define an alias to a permutation matrix type of the Eigen library.
Definition: Matrix.hpp:89
Eigen::Map< Eigen::RowVectorXd > RowVectorMap
< Alias to Eigen type Ref<const RowVectorXd>.
Definition: Matrix.hpp:39
auto diagonal(Eigen::MatrixBase< Derived > &mat) -> decltype(mat.diagonal())
Return a vector representation of the diagonal of a matrix.
Definition: Matrix.hxx:191
std::vector< Index > Indices
Define a type that represents a collection of indices.
Definition: Index.hpp:29
Eigen::Ref< MatrixXi > MatrixXiRef
Alias to Eigen type Eigen::Ref<MatrixXi>.
Definition: Matrix.hpp:74
Eigen::Map< const VectorXd > VectorXdConstMap
Alias to Eigen type Eigen::Map<const VectorXd>.
Definition: Matrix.hpp:65
auto ones(const ChemicalVectorBase< V, T, P, N > &v) -> ChemicalVectorBase< decltype(ones(0)), decltype(zeros(0)), decltype(zeros(0)), decltype(zeros(0, 0))>
Return a ChemicalVectorBase expression representing ones with same dimension of given vector.
Definition: ChemicalVector.hpp:369
Eigen::MatrixXd Matrix
Alias to Eigen type MatrixXd.
Definition: Matrix.hpp:42
Eigen::Map< Eigen::VectorXd > VectorMap
< Alias to Eigen type Ref<const VectorXd>.
Definition: Matrix.hpp:32
auto tr(Eigen::MatrixBase< Derived > &mat) -> decltype(mat.transpose())
Return the transpose of the matrix.
Definition: Matrix.hxx:167
Eigen::Ref< const VectorXd > VectorXdConstRef
Alias to Eigen type Eigen::Ref<const VectorXd>.
Definition: Matrix.hpp:57
Eigen::Ref< const Eigen::MatrixXd > MatrixConstRef
Alias to Eigen type Ref<const MatrixXd>.
Definition: Matrix.hpp:44
Eigen::Ref< Eigen::VectorXd > VectorRef
< Alias to Eigen type VectorXd.
Definition: Matrix.hpp:29
Eigen::Map< const MatrixXi > MatrixXiConstMap
Alias to Eigen type Eigen::Map<const MatrixXi>.
Definition: Matrix.hpp:86
Eigen::Ref< Vector, 0, Eigen::InnerStride<> > VectorStridedRef
< Alias to Eigen type Ref<VectorXd>.
Definition: Matrix.hpp:30
Eigen::Ref< const MatrixXd > MatrixXdConstRef
Alias to Eigen type Eigen::Ref<const MatrixXd>.
Definition: Matrix.hpp:77
auto block(Eigen::MatrixBase< Derived > &mat, Index irow, Index icol, Index nrows, Index ncols) -> decltype(mat.block(irow, icol, nrows, ncols))
Return a view of some rows and columns of a matrix.
Definition: Matrix.hxx:143
Eigen::Ref< const Eigen::VectorXd > VectorConstRef
< Alias to Eigen type Ref<VectorXd>.
Definition: Matrix.hpp:31
Eigen::Ref< VectorXd > VectorXdRef
Alias to Eigen type Eigen::Ref<VectorXd>.
Definition: Matrix.hpp:53
Eigen::Map< const MatrixXd > MatrixXdConstMap
Alias to Eigen type Eigen::Map<const MatrixXd>.
Definition: Matrix.hpp:85
auto diag(const Eigen::MatrixBase< Derived > &vec) -> decltype(vec.asDiagonal())
Return a diagonal matrix representation of a vector.
Definition: Matrix.hxx:185
auto unit(Index rows, Index i) -> decltype(Vector::Unit(rows, i))
Return an expression of a unit vector.
Definition: Matrix.hxx:47
Eigen::Map< const VectorXi > VectorXiConstMap
Alias to Eigen type Eigen::Map<const VectorXi>.
Definition: Matrix.hpp:66
Eigen::VectorXd VectorXd
Alias to Eigen type Eigen::VectorXd.
Definition: Matrix.hpp:49