LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 04-24-2019, 10:54 PM   #1
bsmile
Member
 
Registered: Oct 2017
Posts: 98

Rep: Reputation: Disabled
Unhappy 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?

Last edited by bsmile; 04-24-2019 at 10:55 PM.
 
Old 04-25-2019, 12:16 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by bsmile View Post
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.
 
1 members found this post helpful.
Old 04-25-2019, 01:59 AM   #3
bsmile
Member
 
Registered: Oct 2017
Posts: 98

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-25-2019, 09:06 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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?
 
1 members found this post helpful.
Old 04-25-2019, 12:52 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
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.
 
1 members found this post helpful.
Old 04-25-2019, 01:25 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Linux stuff showed up in your search because the C standard library includes documentation in the form of Linux manpages.
 
Old 04-25-2019, 05:15 PM   #7
bsmile
Member
 
Registered: Oct 2017
Posts: 98

Original Poster
Rep: Reputation: Disabled
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?
 
Old 04-29-2019, 02:59 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
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.
 
  


Reply

Tags
c++, linux, scripting



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
snmpwalk v3 don't bring less information then v1/v2c PoleStar Linux - Newbie 1 09-10-2013 06:23 AM
Bring up and bring don wifi wifi2012 Linux - Networking 3 12-20-2012 01:54 PM
LXer: SetiQuest Project Could Bring The Goodness of Open Source to SETI's Search for Alien Life LXer Syndicated Linux News 0 09-08-2010 07:40 PM
Matrix determinant program in C++ and C. Executable 25 times larger than the other. gregorian Programming 11 06-17-2008 06:52 PM
LXer: SourceForge.net(R) and Krugle Bring Code Search to World's Largest Open Source Software Repository LXer Syndicated Linux News 0 04-10-2007 04:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration