why would search determinant in linux bring up c++ information?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
why would search determinant in linux bring up c++ information?
I happened to search whether linux has tools to do matrix determinant, and ran across google links pointing to the following, which looks very much like standard c++ functions
Linux Man Pages » Linux Man Pages Session 3
determinant (3) - Linux Man Pages
NAME
QuantLib::Matrix - Matrix used in linear algebra.
SYNOPSIS
#include <ql/math/matrix.hpp>
Inherited by Disposable< Matrix >.
My questions are: How to understand it in terms of relationship between c++ and linux (already know linux kernel compiled from c++) and how to use it in linux script?
My questions are: How to understand it in terms of relationship between c++ and linux (already know linux kernel compiled from c++) and how to use it in linux script?
Actually, the kernel is written in C, not C++.
As far as using C++ libs in scripts, you wouldn't. Although there really is not such thing as a "Linux script" so it would help if you were a little more specific about what you are trying to accomplish.
If you need a tool to work with matrices on a Linux platform, I would suggest that you look into GNU Octave.
Thanks for the quick response. I want to evaluate the volume of a 3D object and use it to determine how to assign linux variables. It is not a pure math problem, and I don't want to separate code into different files in different languages, so I was thinking whether linux provides any convenient math library which I can call directly and looked up determinant.
As to searching some keywords in linux yet popping out c like manual, this has happened a few times and I was confused. At the very beginning I was delighted thinking that direct integration of c into linux script brings us quite some convenience, but I hadn't been able to find a way to make use of it with my limited linux knowledge.
It wouldn't necessarily be Linux, the OS, providing a good library to calculate the volume of a 3D object. That would be software and software libraries which may run on any OS, or at least more than one of them.
My point being that Linux is not especially addressing that type of calculation. There likely is plenty of code out there which can do that.
I think it also matters what types of 3D objects you are talking about. Simple geometric things like spheres and cylinders? Or something more complex?
It's kind of tough to answer this more specifically because you've demonstrated misperceptions about programming vs. scripting, and you mention assigning Linux variables which isn't commonly a term used by anyone.
Perhaps you can base this discussion more clearly:
Are you calculating something for personal, work, or school use?
Is this a theoretical calculation?
Is this a calculation that you just need to get done, and done once?
How complex, or not, is the object you are calculating the volume of?
Are you aware of and/or using standard mathematical calculations to calculate something like this on paper?
What are you most comfortable using: script, program, or neither?
there is no strict relation between linux and c++. If you know c++ you can implement what you need (using c++). And it will work. Probably you will need to use a different compiler (because that is always platform specific for c++).
Do you have some existing code (to specify those 3D objects)?
And just a comment: scripts are not written in c or c++, these are not scripting languages, but that is probably irrelevant here.
Thanks for all your very patient and informative responses. They are very enlightening and helpful. I start with Windows and advanced coding language, and I then learned linux on a as needed base. So terminology I used might not be accurate when explaining linux/scripting. The script is for personal use and once for all. The volume is for a tilted cube and is very simple to evaluate. I finally used python to evaluate it, got linux script to call the python file to get the number and proceed with the rest of the job. So, I am still left with two files for scripting and python.
I have been using linux scripting in Bash for some time. I like it very much in some cases and hate it so much in others. The intended way I have towards an ideal linux script is something like
---------------------
linux scripting for file/directory etc control
#python directive:
defined_python_function
python coding needed to solve a specific problem as a function and return a code
#python end of directive:
python defined_python_function
linux scripting receives the code and proceed with more file/directory controls
----------------------
Right now, I am using python to play the role of c++ mentioned in the initial post for easy scripting and avoiding need of compilation. The structure above reflects my wish that linux is able to call external packages to interpret lines of coding between specific directives and then follow the standard "python" way to use it. Although not feasible in linux scripting at the moment, but it sounds to me a quite good idea, is it?
And, maybe the alternative solution is I switch totally to python for all my file/directory needs?
please use [code] tags instead of ----------------------
there is no such thing (linux scripting). linux is not a [programming] language. linux is not able to call external packages too. Probably you mixed the linux shell (which is actually bash) and linux itself.
Yes you are right you can do it [totally] in python (or perl/c++/java/...) and in general better to use only one language - if possible.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.