How Can I Read and Write Matrices in GSL?

  • Thread starter Thread starter gradnu
  • Start date Start date
  • Tags Tags
    Scientific
AI Thread Summary
The discussion centers on reading and writing matrices using the GNU Scientific Library (GSL). Users express confusion regarding the binary format mentioned on the GSL website and seek simpler methods for handling matrices similar to standard C practices. Key functions highlighted include gsl_matrix_get, which retrieves an element from a matrix, and gsl_matrix_set, which assigns a value to a specific matrix element, both of which include error handling for out-of-bounds indices. Additionally, a user inquires about computing double and multiple integrals, noting a lack of information in the GSL manual on this topic.
gradnu
Messages
21
Reaction score
0
Does anybody know how to read and write matrices in GSL. I am confused by what is given on the website. It says something about binary format which I have no idea about.
Isn't there any other simple way of reading the matrices as we do in 'C'?
 
Technology news on Phys.org
Function: double gsl_matrix_get (const gsl_matrix * m, size_t i, size_t j)
This function returns the (i,j)-th element of a matrix m. If i or j lie outside the allowed range of 0 to n1-1 and 0 to n2-1 then the error handler is invoked and 0 is returned.


Function: void gsl_matrix_set (gsl_matrix * m, size_t i, size_t j, double x)
This function sets the value of the (i,j)-th element of a matrix m to x. If i or j lies outside the allowed range of 0 to n1-1 and 0 to n2-1 then the error handler is invoked.
 
Thanks Clive
 
Hello
I have a question GSL about too. Does anybody know how to compute double and multiple integrals? I have not found it in gsl's manual. Thanks.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top