@@ -408,6 +408,68 @@ public static ComplexMatrixF identityComplexF(int n) {
408408 return m ;
409409 }
410410
411+ /**
412+ * Create a {@code (1, 1)} MatrixD matrix holding the given {@code scalar}.
413+ *
414+ * @param scalar
415+ * the scalar value in the created {@code 1 x 1} matrix
416+ * @return a scalar MatrixD matrix of dimension {@code (1, 1)} with the
417+ * given {@code scalar} value
418+ * @since 1.4.4
419+ */
420+ public static MatrixD scalarD (double scalar ) {
421+ return new SimpleMatrixD (1 , 1 , new double [] { scalar });
422+ }
423+
424+ /**
425+ * Create a {@code (1, 1)} MatrixF matrix holding the given {@code scalar}.
426+ *
427+ * @param scalar
428+ * the scalar value in the created {@code 1 x 1} matrix
429+ * @return a scalar MatrixF matrix of dimension {@code (1, 1)} with the
430+ * given {@code scalar} value
431+ * @since 1.4.4
432+ */
433+ public static MatrixF scalarF (float scalar ) {
434+ return new SimpleMatrixF (1 , 1 , new float [] { scalar });
435+ }
436+
437+ /**
438+ * Create a {@code (1, 1)} ComplexMatrixD matrix holding the given complex
439+ * scalar {@code (reVal, imVal)}.
440+ *
441+ * @param reVal
442+ * real part of the complex scalar in the created {@code 1 x 1}
443+ * matrix
444+ * @param imVal
445+ * imaginary part of the complex scalar in the created
446+ * {@code 1 x 1} matrix
447+ * @return a scalar ComplexMatrixD matrix of dimension {@code (1, 1)} with
448+ * the given complex scalar {@code (reVal, imVal)} value
449+ * @since 1.4.4
450+ */
451+ public static ComplexMatrixD scalarComplexD (double reVal , double imVal ) {
452+ return new SimpleComplexMatrixD (1 , 1 , new double [] { reVal , imVal });
453+ }
454+
455+ /**
456+ * Create a {@code (1, 1)} ComplexMatrixF matrix holding the given complex
457+ * scalar {@code (reVal, imVal)}.
458+ *
459+ * @param reVal
460+ * real part of the complex scalar in the created {@code 1 x 1}
461+ * matrix
462+ * @param imVal
463+ * imaginary part of the complex scalar in the created
464+ * {@code 1 x 1} matrix
465+ * @return a scalar ComplexMatrixF matrix of dimension {@code (1, 1)} with
466+ * the given complex scalar {@code (reVal, imVal)} value
467+ * @since 1.4.4
468+ */
469+ public static ComplexMatrixF scalarComplexF (float reVal , float imVal ) {
470+ return new SimpleComplexMatrixF (1 , 1 , new float [] { reVal , imVal });
471+ }
472+
411473 /**
412474 * Create a quadratic diagonal matrix whose main diagonal contains the
413475 * entries provided in the {@code diagonal} array.
0 commit comments