Hi
I know you're not supposed to post OS specific questions on the newsgroup so
does anyone know a good newsgroup - where there are actually people talking
to eachother and not full of spam - where I can get advice on developing C
for a command line driven interface in Linux?
Any advice greatly appreciated.
Kind regards
Dawn
Nov 14 '05
16 1679
On Fri, 11 Feb 2005 05:26:25 GMT, CBFalconer
<cb********@yah oo.com> wrote: Chris Croughton wrote: ... snip ... Since from your email address you're in the UK, you could look at <news:uk.comp.o s.linux>. While a lot of the discussion there is about non-programming stuff (installing, using etc.) there are a number of knowledgable Linux programmers there and it is relatively low-traffic (compared to comp.lang.c for instance).
(Non-UK people could also look at that newsgroup, but it is less likely to be on non-UK servers, I know that it is on the BTInternet one...)
Out of perversity I looked, and att does carry it (and 600 odd other in the uk group) here in left-pondia.
Oh yes, many non-UK servers do carry uk.* newsgroups (some of them, like
the Berlin university public server news.individual .net, carry them on
auto-create), but they are less likely to do so than UK servers in
general, I've had (as UK Usenet Control) a number of queries "Where can
I get uk.<x> newsgroup, my ISP doesn't have it?" from people using
non-UK servers. I usually direct them to the free (for individuals)
server above, or for companies to gradwell.net.
Chris C
Ok, well any chance someone could give me a quick explanation of what this
single line means?
Based on I, K and lda being integers
#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)]
If someone could just explain that one line to me i would be very grateful
The rest of the top of the program looks like this:
/* Subroutine */ int dgemm_(char *transa, char *transb, integer *m, integer
*
n, integer *k, doublereal *alpha, doublereal *a, integer *lda,
doublereal *b, integer *ldb, doublereal *beta, doublereal *c, integer
*ldc)
{
/* System generated locals */
integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1,
i__2,
i__3;
/* Local variables */
static integer info;
static logical nota, notb;
static doublereal temp;
static integer i, j, l, ncola;
extern logical lsame_(char *, char *);
static integer nrowa, nrowb;
extern /* Subroutine */ int xerbla_(char *, integer *);
/*
Parameter adjustments
Function Body */
#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)]
#define B(I,J) b[(I)-1 + ((J)-1)* ( *ldb)]
#define C(I,J) c[(I)-1 + ((J)-1)* ( *ldc)]
Dawn Minnis wrote: Ok, well any chance someone could give me a quick explanation of what this single line means?
Based on I, K and lda being integers #define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)]
If someone could just explain that one line to me i would be very grateful
The rest of the top of the program looks like this:
It is doing treating an one dimentional array as a 1 based two
dimensional array. In C arrays are 0 based (i.e a[0] is the first
element). They want this array to be one based.
lda is not an integer, it is a pointer to an integer, which presumably
has the number of elements in the row.
e.g. if there are 10 elements in a row
A(1,1) -> a[0]; /* first element in first row */
A(2,1) -> a[1]; / second element in first row */
A(1,2) -> a[10]; /* first element in second row */
-David
On Fri, 11 Feb 2005 18:55:42 -0000, in comp.lang.c , "Dawn Minnis"
<da*********@bt internet.com> wrote: Ok, well any chance someone could give me a quick explanation of what this single line means?
Based on I, K and lda being integers #define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)]
looks to me like an extract from Numerical Recipes in C, trying to use a
C-style one-dimensional array "a" as if it were a fortran-style 1-based
2-dimensional array "A". I and J are the row/column indices, and Ida is the
row width. They subtract one because they can't concieve of arrays starting
from zero.
Throw away that book, and buy the new edition, which was rewritten by
people who actually programmed in C.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >
Dawn Minnis wrote: Ok, well any chance someone could give me a quick explanation of what this single line means?
Based on I, K and lda being integers #define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)]
If lda is an integer it will generate syntax errors. lda needs to
be a pointer to an integer. It looks like it is trying to map a 1
based indexing scheme into Cs zero based indexing. It will blow up
badly for I or J values of zero.
--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Thanks guys.
Its a line from the resulting C file after putting dgemm.f through the f2c
converter. The result it genuine C code but it looks horrid. But thanks
for explaining that to me. I wasnt aware that you could do that in C.
Regards
Dawn
On Fri, 11 Feb 2005 23:33:04 -0000, in comp.lang.c , "Dawn Minnis"
<da*********@bt internet.com> wrote: Thanks guys.
Its a line from the resulting C file after putting dgemm.f through the f2c converter. The result it genuine C code but it looks horrid. But thanks for explaining that to me. I wasnt aware that you could do that in C.
You can, but its dangerous, as it could invoke undefined behaviour for some
values of I and J. Better to understand the algo and write your own C.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Randy Yates |
last post by:
Hi Folks,
I'm looking for something that is completely independent of the MSVC++
Dev Studio environment, something that will compile and run under
win32 using the mingw distribution. A class that allows schema
definitions to be made and recordsets to be queried and updated would
be wonderful. It doesn't have to include the kitchen sink!
Simplificity and functionality are the prime desires.
--
% Randy Yates % "...the...
|
by: KevinGPO |
last post by:
Just wondering if anyone knows if there are converters to convert from:
MS Visual C++ 6.0 or
MS Visual Studio 2003
project files into UNIX autogen/configure/make files?
|
by: BGreene |
last post by:
|
by: Jim Hubbard |
last post by:
I am downloading the REALbasic 5.5 demo and was just wondering if anyone
else had tried it.
I am tired of Microsoft constantly changing things and breaking backward
compatibility ON PURPOSE.
I'd like to offer my customers the ability to run my apps on Windows, MAC or
Linux - and REALbasic claims the ability to do that from one set of source
code.
|
by: laredotornado |
last post by:
Hello,
I am tasked with converting an MsAccess db to a MySQL 4 db in a Linux
environment. Can anyone recommend any good freeware/scripts to help me
do this?
Thanks, - Dave
| |
by: changs |
last post by:
Hi, all
I have a asm code, I suspect it sort of socket programming. Can anyone
here give some instructions on how to determine the function or give
the psudo-code in C?
Thanks in advance!
Tony
|
by: JohnQ |
last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post).
It would be more than a little bit nice if C++ was much "cleaner" (less
complex) so that it wasn't a major world wide untaking to create a toolchain
for it. Way back when, there used to be something called "Small C". I wonder
if the creator(s) of that would want to embark on creating a nice little
Small C++ compiler devoid of C++ language features that make...
|
by: Johs |
last post by:
I use Ubuntu 7.04 and have trouble finding a good editor that has
autocompletion (when typing std:: or using "." on strings or pressing
ctrl+space).
I have tried eclipse with CDT 3.1.2 but it takes about a minute before
the popup box appears. I have also tried KDevelop and anjuta but they
only autocomplete previous declared variables. I would like to avoid
using emacs because of the wierd keymap.
Are there any alternatives left or...
|
by: 1jasong |
last post by:
Hello I am new to programming and want to know what is a good free
compiler is. I am asking this because there are so many of them and I
just want to start programming also a good website for programming to
help me, I want to major in the computer programming field and want to
know if there are any really good tutorial sites. Thanks your input
is much appriciated.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |