@@ -97,11 +97,11 @@ class Matrix {
9797 * This performs an element-wise multiplication of the matrix by the scalar value alpha.
9898 *
9999 * Example:
100- * >>> matrix = Matrix(3, 0.0)
101- * >>> matrix *= 2.0
102- * >>> matrix
103- * valarray([0., 0., 0., 0., 0., 0., 0., 0., 0.],
104- * [3])
100+ * @code{.cpp}
101+ * Matrix matrix(3, 0.0);
102+ * matrix *= 2.0;
103+ * // matrix becomes valarray([0., 0., 0., 0., 0., 0., 0., 0., 0.], [3])
104+ * @endcode
105105 *
106106 * @param[in] alpha - The scalar value to multiply the matrix by.
107107 * @return A new Matrix object containing the result of the multiplication.
@@ -116,11 +116,11 @@ class Matrix {
116116 * all diagonal elements to 1.
117117 *
118118 * Example:
119- * >>> matrix = Matrix(3, 0.0)
120- * >>> matrix.identity()
121- * >>> matrix
122- * valarray([1., 0., 0., 0., 1., 0., 0., 0., 1.],
123- * [3])
119+ * @code{.cpp}
120+ * Matrix matrix(3, 0.0);
121+ * matrix.identity();
122+ * // matrix becomes valarray([1., 0., 0., 0., 1., 0., 0., 0., 1.], [3])
123+ * @endcode
124124 */
125125 void identity () {
126126 this ->clear ();
@@ -134,12 +134,13 @@ class Matrix {
134134 * where row index equals column index, corresponding to the diagonal.
135135 *
136136 * Example:
137- * >>> matrix = Matrix(3, 0.0)
138- * >>> matrix(0, 0) = 1.0
139- * >>> matrix(1, 1) = 2.0
140- * >>> matrix(2, 2) = 3.0
141- * >>> matrix.diagonal()
142- * valarray([1., 2., 3.], 3)
137+ * @code{.cpp}
138+ * Matrix matrix(3, 0.0);
139+ * matrix(0, 0) = 1.0;
140+ * matrix(1, 1) = 2.0;
141+ * matrix(2, 2) = 3.0;
142+ * // matrix.diagonal() returns valarray([1., 2., 3.], 3)
143+ * @endcode
143144 *
144145 * @return View of the diagonal elements as a slice_array.
145146 */
@@ -152,12 +153,13 @@ class Matrix {
152153 * where row index + column index equals ndim-1, corresponding to the secondary diagonal.
153154 *
154155 * Example:
155- * >>> matrix = Matrix(3, 0.0)
156- * >>> matrix(0, 0) = 1.0
157- * >>> matrix(1, 1) = 2.0
158- * >>> matrix(2, 2) = 3.0
159- * >>> matrix.secondary_diagonal()
160- * valarray([0., 0.], 2)
156+ * @code{.cpp}
157+ * Matrix matrix(3, 0.0);
158+ * matrix(0, 0) = 1.0;
159+ * matrix(1, 1) = 2.0;
160+ * matrix(2, 2) = 3.0;
161+ * // matrix.secondary_diagonal() returns valarray([0., 0.], 2)
162+ * @endcode
161163 *
162164 * @return View of the secondary diagonal elements as a slice_array.
163165 */
@@ -172,16 +174,15 @@ class Matrix {
172174 * of the specified row index.
173175 *
174176 * Example:
175- * >>> matrix = Matrix(3, 0.0)
176- * >>> matrix(0, 0) = 1.0
177- * >>> matrix(1, 1) = 2.0
178- * >>> matrix(2, 2) = 3.0
179- * >>> matrix.row(0)
180- * valarray([1., 0., 0.], 3)
181- * >>> matrix.row(1)
182- * valarray([0., 2., 0.], 3)
183- * >>> matrix.row(2)
184- * valarray([0., 0., 3.], 3)
177+ * @code{.cpp}
178+ * Matrix matrix(3, 0.0);
179+ * matrix(0, 0) = 1.0;
180+ * matrix(1, 1) = 2.0;
181+ * matrix(2, 2) = 3.0;
182+ * // matrix.row(0) returns valarray([1., 0., 0.], 3)
183+ * // matrix.row(1) returns valarray([0., 2., 0.], 3)
184+ * // matrix.row(2) returns valarray([0., 0., 3.], 3)
185+ * @endcode
185186 *
186187 * @param[in] row - The index of the row to extract.
187188 * @return View of the row elements as a slice_array.
@@ -197,16 +198,15 @@ class Matrix {
197198 * of the specified column index.
198199 *
199200 * Example:
200- * >>> matrix = Matrix(3, 0.0)
201- * >>> matrix(0, 0) = 1.0
202- * >>> matrix(1, 1) = 2.0
203- * >>> matrix(2, 2) = 3.0
204- * >>> matrix.column(0)
205- * valarray([1., 0., 0.], 3)
206- * >>> matrix.column(1)
207- * valarray([0., 2., 0.], 3)
208- * >>> matrix.column(2)
209- * valarray([0., 0., 3.], 3)
201+ * @code{.cpp}
202+ * Matrix matrix(3, 0.0);
203+ * matrix(0, 0) = 1.0;
204+ * matrix(1, 1) = 2.0;
205+ * matrix(2, 2) = 3.0;
206+ * // matrix.column(0) returns valarray([1., 0., 0.], 3)
207+ * // matrix.column(1) returns valarray([0., 2., 0.], 3)
208+ * // matrix.column(2) returns valarray([0., 0., 3.], 3)
209+ * @endcode
210210 *
211211 * @param[in] col - The index of the column to extract.
212212 * @return View of the column elements as a slice_array.
@@ -222,12 +222,13 @@ class Matrix {
222222 * elements, and then summing those elements.
223223 *
224224 * Example:
225- * >>> matrix = Matrix(3, 0.0)
226- * >>> matrix(0, 0) = 1.0
227- * >>> matrix(1, 1) = 2.0
228- * >>> matrix(2, 2) = 3.0
229- * >>> matrix.trace()
230- * 6.0
225+ * @code{.cpp}
226+ * Matrix matrix(3, 0.0);
227+ * matrix(0, 0) = 1.0;
228+ * matrix(1, 1) = 2.0;
229+ * matrix(2, 2) = 3.0;
230+ * // matrix.trace() returns 6.0
231+ * @endcode
231232 *
232233 * @return The trace of the matrix as a double.
233234 */
0 commit comments