Matrix.set

Sets all matrix values in one action. It receives bunch of values.

struct Matrix(size_t Lines, size_t Cols, Type = float)
@trusted pure nothrow
void
set
(
in Type[Cols * Lines] values...
)
if (
Lines > 0 &&
Cols > 0
)

Examples

{
      // Creating matrix
      auto m = Matrix3i
      (
           3, -1, 6,
           2,  1, 5,
          -3,  1, 0
      );

      // Testing some value to be the same as added
      assert (m[2][0] == -3);

      // Setting all values to zero.
      m.set
      (
          0, 0, 0,
          0, 0, 0,
          0, 0, 0
      );

      // Testing some values to be zero. 
      assert (m[0][0] == 0);

Meta