AngouriMath

Navigation

← Back to list of members

PointwiseMultiplication​(AngouriMath.​Entity.​Matrix,​AngouriMath.​Entity.​Matrix)

 Method (no overloads)

Summary

Performs a pointwise multiplication operation,
or throws exception if shapes mismatch

Example

using System;
using static AngouriMath.MathS;
using static AngouriMath.Entity;

Matrix A = @"
[[a, b],
 [c, d]]
";
Matrix B = @"
[[f, g],
 [k, l]]
";
Console.WriteLine((A * B).ToString(multilineFormat: true));
Console.WriteLine(Matrices.PointwiseMultiplication(A, B).ToString(multilineFormat: true));
Console.WriteLine("-------------------");
var v1 = Vector(1, 2, 3);
var v2 = Vector(10, 20, 30);
Console.WriteLine(v1);
Console.WriteLine(v2);
Console.WriteLine((v1.T * v2).AsScalar());

Prints
Matrix[2 x 2]
a * f + b * k   a * g + b * l   
c * f + d * k   c * g + d * l   
Matrix[2 x 2]
a * f   b * g   
c * k   d * l   
-------------------
[1, 2, 3]
[10, 20, 30]
140

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online