-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added tests for to_array functionality * Stream out operator for TypeInfo * formatting * basis function for algebra types * enhanced framework for converting from algebra to array. * remove some redundant asserts * remove cvref on type deductions * formatting * always import numpy if available * lots of little details * moved some functions around to make them accessible * formatting * formatting * imort numpy function * moved definition of __array__ to numpy files * formatting * Create zeroed array first * Added missing zeros to expected arrays * no ownership test - everything copies for now * Added test for array of rationals * fixed some issues with scalar allocations * Updated changelog * Added test for poly scalars to_array * Fixed missing break in switch statement.
- Loading branch information
1 parent
0960fcd
commit 3cdd034
Showing
19 changed files
with
470 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Created by sam on 11/23/23. | ||
// | ||
#include "core.h" | ||
|
||
|
||
std::ostream& rpy::devices::operator<<(std::ostream& os, const TypeInfo& info) | ||
{ | ||
switch (info.code) { | ||
case TypeCode::Int: os << "int" << info.bytes * CHAR_BIT; | ||
break; | ||
case TypeCode::UInt: os << "uint" << info.bytes * CHAR_BIT; | ||
break; | ||
case TypeCode::Float: os << "float" << info.bytes * CHAR_BIT; | ||
break; | ||
case TypeCode::OpaqueHandle: os << "opaque"; | ||
break; | ||
case TypeCode::BFloat: os << "bfloat" << info.bytes * CHAR_BIT; | ||
break; | ||
case TypeCode::Complex: os << "complex" << info.bytes * CHAR_BIT; | ||
break; | ||
case TypeCode::Bool: os << "bool"; | ||
break; | ||
case TypeCode::Rational: os << "Rational"; | ||
break; | ||
case TypeCode::ArbitraryPrecisionInt: os << "mp_int"; | ||
break; | ||
case TypeCode::ArbitraryPrecisionUInt: os << "mp_uint"; | ||
break; | ||
case TypeCode::ArbitraryPrecisionFloat: os << "mp_float"; | ||
break; | ||
case TypeCode::ArbitraryPrecisionComplex: os << "mp_complex"; | ||
break; | ||
case TypeCode::ArbitraryPrecisionRational: os << "Rational"; | ||
break; | ||
case TypeCode::APRationalPolynomial: os << "PolyRational"; | ||
break; | ||
} | ||
|
||
return os; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.