OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
fieldmatrixoperators.hpp
Go to the documentation of this file.
1 
4 /* OpenCMISS-Zinc Library
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #ifndef CMZN_FIELDMATRIXOPERATORS_HPP__
10 #define CMZN_FIELDMATRIXOPERATORS_HPP__
11 
12 #include "zinc/fieldmatrixoperators.h"
13 #include "zinc/field.hpp"
14 #include "zinc/fieldmodule.hpp"
15 
16 namespace OpenCMISS
17 {
18 namespace Zinc
19 {
20 class FieldDeterminant : public Field
29 {
30 private:
31  // takes ownership of C handle, responsibility for destroying it
32  explicit FieldDeterminant(cmzn_field_id field_id) : Field(field_id)
33  { }
34 
35  friend FieldDeterminant Fieldmodule::createFieldDeterminant(const Field& sourceField);
36 
37 public:
38 
39  FieldDeterminant() : Field(0)
40  { }
41 
42 };
43 class FieldEigenvalues : public Field
52 {
53 private:
54  // takes ownership of C handle, responsibility for destroying it
55  explicit FieldEigenvalues(cmzn_field_id field_id) : Field(field_id)
56  { }
57 
58  friend FieldEigenvalues Fieldmodule::createFieldEigenvalues(const Field& sourceField);
59 
60 public:
61 
62  FieldEigenvalues() : Field(0)
63  { }
64 
65 };
66 class FieldEigenvectors : public Field
76 {
77 private:
78  // takes ownership of C handle, responsibility for destroying it
79  explicit FieldEigenvectors(cmzn_field_id field_id) : Field(field_id)
80  { }
81 
82  friend FieldEigenvectors Fieldmodule::createFieldEigenvectors(
83  const FieldEigenvalues& eigenValuesField);
84 
85 public:
86 
87  FieldEigenvectors() : Field(0)
88  { }
89 
90 };
91 class FieldMatrixInvert : public Field
100 {
101 private:
102  // takes ownership of C handle, responsibility for destroying it
103  explicit FieldMatrixInvert(cmzn_field_id field_id) : Field(field_id)
104  { }
105 
106  friend FieldMatrixInvert Fieldmodule::createFieldMatrixInvert(const Field& sourceField);
107 
108 public:
109 
110  FieldMatrixInvert() : Field(0)
111  { }
112 
113 };
114 class FieldMatrixMultiply : public Field
127 {
128 private:
129  // takes ownership of C handle, responsibility for destroying it
130  explicit FieldMatrixMultiply(cmzn_field_id field_id) : Field(field_id)
131  { }
132 
133  friend FieldMatrixMultiply Fieldmodule::createFieldMatrixMultiply(int numberOfRows,
134  const Field& sourceField1, const Field& sourceField2);
135 
136 public:
137 
138  FieldMatrixMultiply() : Field(0)
139  { }
140 
141 };
142 class FieldProjection : public Field
166 {
167 private:
168  // takes ownership of C handle, responsibility for destroying it
169  explicit FieldProjection(cmzn_field_id field_id) : Field(field_id)
170  { }
171 
172  friend FieldProjection Fieldmodule::createFieldProjection(const Field& sourceField,
173  const Field& projectionMatrixField);
174 
175 public:
176 
177  FieldProjection() : Field(0)
178  { }
179 
180 };
181 class FieldTranspose : public Field
191 {
192 private:
193  // takes ownership of C handle, responsibility for destroying it
194  explicit FieldTranspose(cmzn_field_id field_id) : Field(field_id)
195  { }
196 
197  friend FieldTranspose Fieldmodule::createFieldTranspose(int sourceNumberOfRows,
198  const Field& sourceField);
199 
200 public:
201 
202  FieldTranspose() : Field(0)
203  { }
204 
205 };
206 
208 {
209  return FieldDeterminant(cmzn_fieldmodule_create_field_determinant(id,
210  sourceField.getId()));
211 }
212 
214 {
215  return FieldEigenvalues(cmzn_fieldmodule_create_field_eigenvalues(id,
216  sourceField.getId()));
217 }
218 
220 {
221  return FieldEigenvectors(cmzn_fieldmodule_create_field_eigenvectors(id,
222  eigenValuesField.getId()));
223 }
224 
226 {
227  return FieldMatrixInvert(cmzn_fieldmodule_create_field_matrix_invert(id,
228  sourceField.getId()));
229 }
230 
232  const Field& sourceField1, const Field& sourceField2)
233 {
234  return FieldMatrixMultiply(cmzn_fieldmodule_create_field_matrix_multiply(id,
235  numberOfRows, sourceField1.getId(), sourceField2.getId()));
236 }
237 
239  const Field& projectionMatrixField)
240 {
241  return FieldProjection(cmzn_fieldmodule_create_field_projection(id,
242  sourceField.getId(), projectionMatrixField.getId()));
243 }
244 
245 inline FieldTranspose Fieldmodule::createFieldTranspose(int sourceNumberOfRows,
246  const Field& sourceField)
247 {
248  return FieldTranspose(cmzn_fieldmodule_create_field_transpose(id,
249  sourceNumberOfRows, sourceField.getId()));
250 }
251 
252 } // namespace Zinc
253 }
254 
255 #endif
FieldMatrixMultiply createFieldMatrixMultiply(int numberOfRows, const Field &sourceField1, const Field &sourceField2)
Definition: fieldmatrixoperators.hpp:231
FieldEigenvalues createFieldEigenvalues(const Field &sourceField)
Definition: fieldmatrixoperators.hpp:213
A field returning the transpose of N*M matrix source_field.
Definition: fieldmatrixoperators.hpp:190
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
A field returning the scalar real determinant of a square matrix source field.
Definition: fieldmatrixoperators.hpp:28
FieldMatrixInvert createFieldMatrixInvert(const Field &sourceField)
Definition: fieldmatrixoperators.hpp:225
cmzn_field_id getId() const
Definition: field.hpp:98
A field returning the inverse of N*N symmetric matrix valued source field.
Definition: fieldmatrixoperators.hpp:99
A field returning the N, N-dimensional eigenvectors computed with the source eigenvalues field...
Definition: fieldmatrixoperators.hpp:75
A field returning the values resulting from matrix multiplication <source_field1> x <source_field2>...
Definition: fieldmatrixoperators.hpp:126
FieldTranspose createFieldTranspose(int sourceNumberOfRows, const Field &sourceField)
Definition: fieldmatrixoperators.hpp:245
A projection field returning the result of a matrix multiplication with perspective division on the s...
Definition: fieldmatrixoperators.hpp:165
FieldEigenvectors createFieldEigenvectors(const FieldEigenvalues &eigenValuesField)
Definition: fieldmatrixoperators.hpp:219
FieldProjection createFieldProjection(const Field &sourceField, const Field &projectionMatrixField)
Definition: fieldmatrixoperators.hpp:238
A field returning the N eigenvalues of symmetric N*N component source field.
Definition: fieldmatrixoperators.hpp:51
FieldDeterminant createFieldDeterminant(const Field &sourceField)
Definition: fieldmatrixoperators.hpp:207