public void set(int comp, double val) { set(comp, (float) val); }
public void set(int comp, double val) { set(comp, (float) val); }
public VectorNf transform(float... vec) { final int size = size(); if (size != vec.length) { throw new IllegalArgumentException("Matrix and vector sizes must be the same"); } final VectorNf d = new VectorNf(size); for (int row = 0; row < size; row++) { float dot = 0; for (int col = 0; col < size; col++) { dot += mat[row][col] * vec[col]; } d.set(row, dot); } return d; }
public VectorNf transform(float... vec) { final int size = size(); if (size != vec.length) { throw new IllegalArgumentException("Matrix and vector sizes must be the same"); } final VectorNf d = new VectorNf(size); for (int row = 0; row < size; row++) { float dot = 0; for (int col = 0; col < size; col++) { dot += mat[row][col] * vec[col]; } d.set(row, dot); } return d; }
@Override public VectorNf getRow(int row) { final int size = size(); final VectorNf d = new VectorNf(size); for (int col = 0; col < size; col++) { d.set(col, get(row, col)); } return d; }
@Override public VectorNf getColumn(int col) { final int size = size(); final VectorNf d = new VectorNf(size); for (int row = 0; row < size; row++) { d.set(row, get(row, col)); } return d; }
@Override public VectorNf getRow(int row) { final int size = size(); final VectorNf d = new VectorNf(size); for (int col = 0; col < size; col++) { d.set(col, get(row, col)); } return d; }
@Override public VectorNf getColumn(int col) { final int size = size(); final VectorNf d = new VectorNf(size); for (int row = 0; row < size; row++) { d.set(row, get(row, col)); } return d; }