Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
edmond-chow authored Jan 10, 2024
1 parent db5b2bb commit c641bc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 10 additions & 0 deletions C#/Complex.rar/Complex/Complex/Cayley Dickson Algebra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@ public Number(params double[] Numbers)
Data = new double[Numbers.LongLength];
for (long i = 0; i < Data.LongLength; ++i) { Data[i] = Numbers[i]; }
}
public Number(double[] Numbers, long Size)
{
Data = new double[Size > Numbers.LongLength ? Size : Numbers.LongLength];
for (long i = 0; i < Numbers.LongLength; ++i) { Data[i] = Numbers[i]; }
}
public Number(in double[] Numbers)
{
Data = Numbers;
}
public Number(in double[] Numbers, long Size)
{
Data = Numbers;
Extend(Size);
}
public Number Clone()
{
return new Number(Data);
Expand Down
7 changes: 4 additions & 3 deletions C#/Complex.rar/Complex/Complex/Sedenion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ private static long GetDimension(long Value)
///
/// basis
///
private const long BasicSize = 16;
private readonly Number Data;
public Sedenion()
{
Data = new Number(16);
Data = new Number(BasicSize);
}
public Sedenion(params double[] Numbers)
{
Data = new Number(Numbers);
Data = new Number(Numbers, BasicSize);
}
public Sedenion(in double[] Numbers)
{
Data = new Number(in Numbers);
Data = new Number(in Numbers, BasicSize);
}
public Sedenion Clone()
{
Expand Down

0 comments on commit c641bc1

Please sign in to comment.