Times implements Matrix<T> { @Override public Vect<T> apply(final Vect<T> input) { return new com.aljebra.vector.Times<T>( this.matrix.apply(input), this.scalar ); } Times(final Matrix<T> mat, final Scalar<T> scalar); @Override Scalar<T>[] coords(); @Override Scalar<T>[] column(final int index); @Override Scalar<T>[] line(final int index); @Override Vect<T> apply(final Vect<T> input); @Override int columns(); @Override int lines();  }
@Test public void appliesTimesTransformation() { final int lines = 3; final int cols = 4; final FixedMatrix<Object> first = new FixedMatrix<>( lines, cols, new Scalars<>(lines * cols) ); final Vect<Object> input = new FixedVector<>(new Scalars<>(cols)); final Scalar<Object> factor = new Scalars<>(1).iterator().next(); MatcherAssert.assertThat( new Times<Object>(first, factor).apply(input), Matchers.equalTo( new com.aljebra.vector.Times<Object>(first.apply(input), factor) ) ); }