Questions tagged [spire]

Spire is a numeric library for Scala

Using features such as specialization, macros, type classes, and implicits, Spire provides support for rational, complex, real numbers and intervals, along with algebraic type classes such as monoid, ring or vector space. While optimized for high performance, numeric, fractional and integral algebra also have conversions to the standard Scala implementations.

47 questions
10
votes
0 answers

Breeze vs. Spire: Can/should I combine them?

I use breeze's collections (namely DenseVector), in which I have integers and doubles and the like, and use them a little like you might use numpy's arrays. I stumbled upon https://github.com/non/spire. My impression is, it is not so strong on…
Make42
  • 12,236
  • 24
  • 79
  • 155
6
votes
2 answers

Sum or Product of Rationals with Spire (how to get a scala.Numeric)

I thought this should be straight forward: import spire.math.Rational val seq = Vector(Rational(1, 4), Rational(3, 4)) val sum = seq.sum // missing: scala.Numeric val prod = seq.product // missing: scala.Numeric I guess this is just a…
0__
  • 66,707
  • 21
  • 171
  • 266
3
votes
1 answer

How to make implicits available to reflection

Using the Scala (runtime) relection API, I'm trying to compile code that makes heavy use of implicits (actually the spire.math library): val src = "(a: spire.math.Jet[Double],b: spire.math.Jet[Double]) => a + b" println(…
NietzscheanAI
  • 966
  • 6
  • 16
3
votes
1 answer

Convert excel file to jpg in c#

I am trying to use Spire dll to convert excel file to jpg . so i have a xlsm file like this : i use this code to convert it to jpg : Workbook workbook = new Workbook(); workbook.LoadFromFile(@"D:\a.xlsm"); Worksheet sheet =…
Ehsan Akbar
  • 6,977
  • 19
  • 96
  • 180
2
votes
2 answers

How to merge multiple A4 PDFs to A3 PDF using C#

Here i want to merge two Individual A4 PDFs to A3 PDFs.The A4 PDF pages should be fit into A3 2-ups that is side by side view. I didn't tried any code still now but before i want to know is this possible? Note : A4 PDFs can have "N" number of pages…
k.vinod
  • 23
  • 4
2
votes
2 answers

C# Spire.Xls - error with data table (adding legend keys)

This is my code: using System.Drawing; using Spire.Xls; using System; using System.Windows.Forms.DataVisualization; using Spire.Xls.Charts; namespace XLS_Program { class Program { static void Main(string[] args) { Workbook…
westman379
  • 493
  • 1
  • 8
  • 25
2
votes
1 answer

scala's spire framework : I am unable to operate on a group

I try to use spire, a math framework, but I have an error message: import spire.algebra._ import spire.implicits._ trait AbGroup[A] extends Group[A] final class Rationnel_Quadratique(val n1: Int = 2)(val coef: (Int, Int)) { override def toString…
lolveley
  • 1,659
  • 2
  • 18
  • 34
1
vote
1 answer

Spire Doc Free 3.9.0 not running in headless server

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.spire.doc.packages.sprDGC at com.spire.doc.formatting.CharacterFormat.spr (Unknown Source) at com.spire.doc.formatting.CharacterFormat.spr (Unknown Source) …
deon lobo
  • 23
  • 2
1
vote
1 answer

Spire.DOC NullReference when adding row to table

I'm generating pdf with Spire.Doc (https://ibb.co/6sW9cjk). In different sub that code works nicely, but when copied to another sub (will provide the same functionallity as original one) code breaks. Simple: get first row of table fill cells with…
1
vote
1 answer

scala spire interval giving wrong result

Scala spire is giving the following result. As per my understanding goes it must give List((0.0,0.1],[3.0,5.0)). Why such result? scala> val x = Interval.openLower(0.0,0.1) x: spire.math.Interval[Double] = (0.0, 0.1] scala> val y =…
Curious
  • 921
  • 1
  • 9
  • 25
1
vote
0 answers

@specialized complementary informations

I'm trying to implement generic functions working on different type of vector which can be real, binary, and mixt. Mixt are wrapped inside a class composed of both real and binary part. import spire.math.{Numeric => SNumeric} // basic function…
KyBe
  • 842
  • 1
  • 14
  • 33
1
vote
1 answer

using spire and breeze in the same project confuses intellij

I'm using intellij 2018.2 CE, With a scala 2.12.7 project, having dependencies on spire 0.14.1 and breeze 0.13.2 in the same projet completely confuses intellij about spire.algebra typeclasses used in my code (Ring, Order, Eq, Semiring, etc) (Symbol…
remi
  • 566
  • 3
  • 13
1
vote
1 answer

Interop to Spire Migration, formula is getting hard coded

I am moving my C# project from the Interop to Spire. Below piece of code is working in Interop, but not in Spire:- Interop:- When I provide the formula "=SUM(F2,G2)" across the range, it automatically gets appied to the range of cells for…
Jainneha
  • 11
  • 1
1
vote
1 answer

Accessing Spire.PdfViewer.Wpf.dll via Nuget

I am working with Spire.PdfViewer for a WPF Application. After downloading the package, the Spire.PdfViewer.Wpf.dll should be found in the bin folder of my project. Unfortunately I'm not able to find the library on my network. The documentation is…
Gabriel
  • 189
  • 2
  • 10
1
vote
0 answers

ambiguous implicit values doing conversions with json types

I am trying to make a generic mapper from a JValue (from json4s) to a Scala case class (with contains spire numeric existential type) and vice versa having the scala case class similar to : case class SomeStat[T : Numeric](a:T, b:T) for the generic…
legramira
  • 598
  • 6
  • 13
1
2 3 4