@Test public void testFunctionalView() { Matrix m = Matrices.functionalMatrixView(5, 6, new IntIntFunction() { @Override public double apply(int row, int col) { assertTrue(row < 5); assertTrue(col < 6); return row + col; } }); assertEquals(135, m.aggregate(Functions.PLUS, Functions.IDENTITY), 1e-10); }
public static Matrix functionalMatrixView(final int rows, final int columns, final IntIntFunction gf, final boolean denseLike) { return new FunctionalMatrixView(rows, columns, gf, denseLike); }
Matrices { public static Matrix functionalMatrixView(final int rows, final int columns, final IntIntFunction gf, final boolean denseLike) { return new FunctionalMatrixView(rows, columns, gf, denseLike); } }
Matrices { public static Matrix functionalMatrixView(final int rows, final int columns, final IntIntFunction gf, final boolean denseLike) { return new FunctionalMatrixView(rows, columns, gf, denseLike); }  }
Matrices { public static Matrix functionalMatrixView(final int rows, final int columns, final IntIntFunction gf, final boolean denseLike) { return new FunctionalMatrixView(rows, columns, gf, denseLike); }  static Matrix functionalMatrixView(final int rows,
                                                  final int columns,
                                                  final IntIntFunction gf,
                                                  final boolean denseLike); static Matrix functionalMatrixView(final int rows,
                                                  final int columns,
                                                  final IntIntFunction gf); static Matrix transposedView(final Matrix m); static Matrix gaussianView(final int rows,
                                          final int columns,
                                          long seed); static Matrix symmetricUniformView(final int rows,
                                                  final int columns,
                                                  int seed); static Matrix uniformView(final int rows,
                                         final int columns,
                                         int seed); static IntIntFunction gaussianGenerator(final long seed); static IntIntFunction uniformSymmetricGenerator(final int seed); static IntIntFunction uniformGenerator(final int seed); }
Matrices { public static Matrix functionalMatrixView(final int rows, final int columns, final IntIntFunction gf, final boolean denseLike) { return new FunctionalMatrixView(rows, columns, gf, denseLike); }  static Matrix functionalMatrixView(final int rows,
                                                  final int columns,
                                                  final IntIntFunction gf,
                                                  final boolean denseLike); static Matrix functionalMatrixView(final int rows,
                                                  final int columns,
                                                  final IntIntFunction gf); static Matrix transposedView(final Matrix m); static Matrix gaussianView(final int rows,
                                          final int columns,
                                          long seed); static Matrix symmetricUniformView(final int rows,
                                                  final int columns,
                                                  int seed); static Matrix uniformView(final int rows,
                                         final int columns,
                                         int seed); static IntIntFunction gaussianGenerator(final long seed); static IntIntFunction uniformSymmetricGenerator(final int seed); static IntIntFunction uniformGenerator(final int seed);  }