## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• May 21 03:24

github-actions[bot] on gh-pages

deploy: e361e57dd57cb16c9551422… (compare)

• May 21 03:19

armanbilge on main

only test against longs that do… test cube get rid of unecessary comments and 8 more (compare)

• May 21 03:19
armanbilge closed #1173
• May 21 03:19
armanbilge closed #1106
• May 20 03:24
kschwarz1116 synchronize #1173
• May 19 14:49
kschwarz1116 synchronize #1173
• May 19 04:59
kschwarz1116 synchronize #1173
• May 19 04:07
armanbilge commented #756
• May 19 03:56
kschwarz1116 commented #756
• May 16 03:56
kschwarz1116 synchronize #1173
• May 16 03:35
kschwarz1116 opened #1173
• May 13 17:38
scala-steward opened #1172
• May 09 03:31
kschwarz1116 commented #1106
• May 09 03:17
armanbilge closed #715
• May 09 03:17
armanbilge commented #715
• May 09 03:15
armanbilge closed #679
• May 09 03:15
armanbilge commented #679
• May 09 03:08
armanbilge closed #404
• May 09 03:08
armanbilge commented #404
• May 09 03:05
armanbilge commented #207
Denis Rosset
@denisrosset
A field is a division ring, with the condition on top that multiplication is commutative
For example, the quaternions form a division ring, but not a field
For your Complicate trait, I can think of two possible structures
One of them, given a type T representing either a subfield of the reals, or an approximation of the reals, returns the corresponding complex type, and provides the imaginary unit
The other one describes a complex structure on top of a real vector space: https://en.wikipedia.org/wiki/Linear_complex_structure
(it's basically a morphism that describes the multiplication by the imaginary unit)
Paul Snively
@paul-snively
@srnb_gitlab: Is Complex not what you want?
Soren
@srnb_gitlab
@paul-snively I want a typeclass. Complex has an instance of that typeclass
@denisrosset Thank you, I'll check division ring out and adjust my code accordingly
Paul Snively
@paul-snively
@srnb_gitlab: Ah, I see what you mean.
Denis Rosset
@denisrosset
@srnb_gitlab Careful if you widen your type to accept noncommutative typeclasses
If you don't test your code with things that actually are noncommutative, bad things happen
I cleaned up some stuff in Spire due to that
You can use Quaternion for tests though
Soren
@srnb_gitlab
@denisrosset Well, I don't know what operations "require" commutative multiplication, persay
I should probably email my past LinAlg prof, I know that he's a software dev (but I'm not sure if he does fp or theory or anything related to that)
@lemastero
Hello, looks like spire for scalajs is released for 0.6 but there is no artifacts for scalajs 1.0 and 1.1. Any chance to publish for latest scalajs?
Oliver Winks
@PaperPlaneSoftware
Hi guys
is there any support for vectors in Spire?
I'm making a multi-agent simulation and need something to do basic 3d maths stuff
Denis Rosset
@denisrosset
Not really; but you can define your own Vector3D[A] class, and make instances of VectorSpace[Vector3D[A], A] available where A is a field
Then you get the property tests of VectorSpace for free
@lemastero I'm waiting to get publish rights in the typelevel repo
Oliver Winks
@PaperPlaneSoftware
@denisrosset thanks :thumbsup:
@denisrosset I saw some discussion of a cross product implementation and came across Zainab's PR (looked promising) any idea what happened to that work?
Soren
@srnb_gitlab
Is there a good way to send Reals over the wire?
Soren
@srnb_gitlab
Spire Matrices are mutable?
Luka Jacobowitz
@LukaJCB
there’s circe-spire, but I think it might be missing instances for Real
Valeriy Avanesov
@akopich
Hi. Does spire define a type for positive integers? Looks like Naturals include zero.
Feels like it would be extremely useful in combination with non-empty collections.
Paul Snively
@paul-snively
Hi everyone! I'm looking at Erik Osheim's wonderful https://www.youtube.com/watch?v=O78hnJuzQwA and wondering whether that elist library is out there somewhere I should be aware of?
I'm asking here because I figure Erik is likely to see it, sooner or later, but if anyone knows a better way to contact him, I'd appreciate knowing about it.
Carlos Quiroz
@cquiroz
Hello, I’m thinking to use UInt but I noted there is no ConvertableFrom nor ConvertableTo Uint unlike, e.g. Natural
Is there a reason for that?
Denis Rosset
@denisrosset
@akopich Why not use BigInt with https://github.com/fthomas/refined ? Natural is kind of a weird type
@cquiroz The whole ConvertableFrom, ConvertableTo business is not necessarily very principled. That said, using UInt with those typeclasses is likely to lead to boxing if the JIT is not clever enough.
Carlos Quiroz
@cquiroz
Thanks @denisrosset I have an entity that only takes positive numbers, I’ll take a look at refined
Valeriy Avanesov
@akopich
@denisrosset that would be an option, but I want to have at least some basic arithmetics on that type. E.g. positive plus positive should be also positive. Refined types don't give that.
Denis Rosset
@denisrosset
Why not a wrapper that only defines the + operation? Also, are you planning to have collections whose size is bigger than 2^63? You could use a wrapper around a Long then
I'd be wary of introducing a dependency on Spire if you don't have further need for the library
Valeriy Avanesov
@akopich

Why not a wrapper...

that's how i've implemented it eventually.

In fact, I wrapped Int.
Soren
@srnb_gitlab
Does Spire have an equivalent in the Haskell world?
Paul Snively
@paul-snively
There are various numerical libraries for Haskell, but I don’t know of a kind of single umbrella that’s equivalent.
Soren
@srnb_gitlab
What are the uhh... Big O for Real#ceil, Real#floor, Real#log2?
Bro I hate this "i before e" rule because "ceiling" always feels like it shouldn't count even though it is after C but you have words like "ancient"
Martijn Hoekstra
@martijnhoekstra
there is no "i before e" rule
Soren
@srnb_gitlab
Well "ceiling" is the really hard one because it's like "see-əl-ing" so the first thought that comes to mind is "cieling" but that's a misspelling