linear-algebra

Solving a linear equation

I need to programmatically solve a system of linear equations in C, Objective C, or (if needed) C++. Here's an example of the equations: -44.3940 = a * 50.0 + b * 37.0 + tx-45.3049 = a * 43.0 + b * 39.0 + tx-44.9594 = a * 52.0 + b * 41.0 + tx From this, I'd like to get the best approximation for a, b, and tx....

Is there a library for Linear algebra matrix handling in Java?

Is there any libraries in java that allow using mathematical matrices? I am looking for a library that allows me to perform operations in matrices such as invert, scalar multiplication, linear transformations, etc. etc. etc. In a nutshell, the operations required for lineal algebra. ...

Books & resources to teach myself Linear Algebra

The title says it all basically, I'm looking for books and resource to teach myself linear algebra to be used in 3D graphics programming. I prefer practical approaches to teaching over theoretical (even though math is what, 99.99% theory?) ones, so the dream resource for me would be a book that tackles linear algebra as it's used with 3D...

Matrix Template Library matrix inversion

I'm trying to inverse a matrix with version Boost boost_1_37_0 and MTL mtl4-alpha-1-r6418. I can't seem to locate the matrix inversion code. I've googled for examples and they seem to reference lu.h that seems to be missing in the above release(s). Any hints? @Matt suggested copying lu.h, but that seems to be from MTL2 rather than MTL4....

Best base type to deal with linear algebra

I'm writing a small and inadequate linear algebra library in C++ for a project (I'm sorry). I'm implementing matrices and operations using double precision numbers. I'm doing right? Should I implement a template class instead? Is there a more precise type around? ...

C# linear algebra library

Is there stable linear algebra (more specifically, vectors, matrices, multidimensional arrays and basic operations on them) library for C#? Search yielded a few open source libraries which are either not updated for couple of years or are in an early beta stage - and Centerspace NMath. Which alternatives are worth checking? ...

Is there around a straightforward way to invert a triangular (upper or lower) matrix?

Hello, I'm trying to implement some basic linear algebra operations and one of these operations is the inversion of a triangular (upper and/or lower) matrix. Is there an easy and stable algorithm to do that? Thank you. ...

Linear Programming Problem with Complication

I'm trying to solve a problem that looks like a standard Linear Programming problem with one twist. We have as input a set of "phrases" each of which has a weight. We need to choose how many times to repeat each phrase in a text to maximize the total weight, subject to a max character length limitation. This seems like a straightforwa...

Test for invertability using Jama.Matrix

I have a program that uses JAMA and need to test is a matrix can be inverted. I know that I can just try it and catch an exception but that seems like a bad idea (having a catch block as part of the "normal" code path seems to be bad form). A test that also returns the inverse (or run in a better O() than the inverse operation) would be...

What is SVD(singular value decomposition)

How does it actually reduce noise..can you suggest some nice tutorials? ...

How to check if m n-sized vectors are linearly independent?

Disclaimer This is not strictly a programming question, but most programmers soon or later have to deal with math (especially algebra), so I think that the answer could turn out to be useful to someone else in the future. Now the problem I'm trying to check if m vectors of dimension n are linearly independent. If m == n you can just bui...

Matrix Market into CRS conversion (sparse matrices)

When dealing with sparse matrices, how do I convert Matrix Market format into CRS (Compressed Row Storage)? ...

How do I solve a set of constraints in Perl?

I have the following set of constraints in Perl (just a sample set of constraints, not the ones I really need): $a < $b $b > $c $a is odd => $a in [10..18] $a > 0 $c < 30 And I need to find a list ($a, $b, $c) that meet the constraints. My naive solution is sub check_constraint { my ($a, $b, $c) = @_; if !($a < $b) {return 0...

Assistance Needed with Java Colt Matrix Package

Can anyone tell me how you can delete columns from a matrix using the Colt library? TIA. ...

What are your experiences with numerics libraries for C#, and which would you recommend?

By numerics library I mean a library providing data types such as matrices, vectors, and common (numerical) linear algebra algorithms. Optionally FTT and statistical algorithms. I'm primarily interested in ease of use, ideally getting much closer to Matlab in terms of expressiveness. ...

Programming an algebra equation.

Hi, in another post, MSN gave me a good guide on solving my algebra problem (http://stackoverflow.com/questions/639215/calculating-bid-price-from-total-cost). Now, even though I can calculate it by hand, I'm completely stuck on how to write this in pseudocode or code. Anyone could give me a quick hint? By the way, I want to calculate th...

Linear algebra library for the D programming language.

I'm looking for a package to do matrix math with matrices of up to about 100 x 100. I need to, at a minimum, do inverses, multiplication and transposition. I'd prefer a more encapsulated interface over higher performance. ...

linear simulation of multidimensional array

I know how to simulate a 2d array in a linear array using [x + y * width] as a linear index. I can extend this to 3d arrays: [x + y * width + z * width * height]. Is there a general formula for N-dimensional array? I'm looking for a language-agnostic answer. ...

What should I really name the variable which represents the sum of a vector's components?

Is there a valid math term? I could just name this guy "sumXY", but that is (a) lame, and (b) not scalable, since going up a dimension would require a rename. While typing I thought of "componentSum", but I'd love to know if there's a real name for it. ...

Rotation and Scaling -- How to do both and get the right result?

I've got a set of Java2D calls that draw vectors on a graphics context. I'd like for the image to be doubled in size and then rotated 90 degrees. I'm using the following code to do this: Graphics2D g2 = // ... get graphics 2d somehow ... AffineTransform oldTransform = g2.getTransform(); AffineTransform newTransform = (AffineTransform)...