package odin-algebra:algebraic_structures/ring
Overview
Interface for a Ring and CommutativeRing add - called to perform the operation ans = left + right sub - called to perform the operation ans = left - right mul - called to perform the operation ans = left * right neg - called to perform the operation ans = -left add_identity - a + additive_identity == a for all a mul_identity - a * mul_identity == a for all a all functions can be called where 2 or 3 input parameters point to the same piece of memory
Index
Types (2)
Variables (0)
This section is empty.
Procedure Groups (0)
This section is empty.
Types
CommutativeRing ¶
CommutativeRing :: struct($T: typeid) { … // See source for fields }
Has no additional operations above what Ring has just indicates to the type system that addition is commutative
Related Procedures With Parameters
Ring ¶
Ring :: struct($T: typeid) { … // See source for fields }
Interface for a ring: add - called to perform the operation ans = left + right sub - called to perform the operation ans = left - right mul - called to perform the operation ans = left * right neg - called to perform the operation ans = -left add_identity - a + additive_identity == a for all a mul_identity - a * mul_identity == a for all a all functions can be called where 2 or 3 input parameters point to the same piece of memory
Related Procedures With Parameters
Constants
RING_F32 ¶
RING_F32: CommutativeRing($T=f32) : CommutativeRing(f32){Ring(f32){base.BASE_F32, add_f32, sub_f32, mul_f32, neg_f32, 0, 1}}
RING_I32 ¶
RING_I32: CommutativeRing($T=i32) : CommutativeRing(i32){Ring(i32){base.BASE_I32, add_i32, sub_i32, mul_i32, neg_i32, 0, 1}}
RING_I64 ¶
RING_I64: CommutativeRing($T=i64) : CommutativeRing(i64){Ring(i64){base.BASE_I64, add_i64, sub_i64, mul_i64, neg_i64, 0, 1}}
RING_U32 ¶
RING_U32: CommutativeRing($T=u32) : CommutativeRing(u32){Ring(u32){base.BASE_U32, add_u32, sub_u32, mul_u32, neg_u32, 0, 1}}
Variables
This section is empty.
Procedures
integer_pow ¶
sets ans = x^power for any ring
test_commutative_ring_axioms ¶
test_commutative_ring_axioms :: proc(t: ^testing.T, generator: prop_test.Generator($T), ring: CommutativeRing($T)) {…}
called to run prop based tests to see if a ring implementation violates the commutative ring axioms
test_memory_safety_axioms ¶
test_memory_safety_axioms :: proc(t: ^testing.T, generator: prop_test.Generator($T), ring: Ring($T)) {…}
called to run prop based tests to see if a ring implementation is memory safe
test_ring_axioms ¶
called to run prop based tests to see if a ring implementation violates the ring axioms
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-2025-04 (vendor "odin") Linux_amd64 @ 2025-05-13 09:15:55.503356514 +0000 UTC