Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 401
    • Issues 401
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1466
Closed
Open
Created Mar 04, 2003 by Sven-Bodo Scholz@sbsOwner

Unterschied Bibliothek <-> standalone [complex.sac]

Bugzilla Link 1
Created on Mar 04, 2003 09:59
Resolution WONTFIX
Resolved on Oct 15, 2004 17:10
Version 1.00beta
OS SunOS
Architecture Sun

Extended Description

[should be in English]
ich habe mich gerade mal wieder an das Problem gesetzt, die
Complex-Bibliothek f\374r Arrays zu erweitern.
Das angeh\344ngte Programm zeigt, wie ich mir die Erweiterung von Skalaren
Complex-Operationen auf Array-Operationen vorstelle und funktioniert
auch anstandslos.
Ich habe die selbe Operation zur Comples-Bibliothek hinzugef\374gt, dort
l\344sst sie sich aber nicht \374bersetzen und liefert eine Fehlermeldung
(unknown shape). Du kannst dies \374berpr\374fen, in dem du ein Update auf der
stdlib machst und die Kommentarzeichen in Complex.sac und Complex.dec
l\366schst.
Hast du einen guten Tipp f\374r mich, wie man das Problem l\366sen kann?
import ArrayIO: all;
import Array:all;
typedef double[2] complex;
inline complex + (complex X1, complex X2)
{  
  return((:complex)[((:double[2])X1)[[0]] + ((:double[2])X2)[[0]],
                    ((:double[2])X1)[[1]] + ((:double[2])X2)[[1]]]);
}  
   
inline complex[+] + (complex[+] X1, complex X2)
{
  res = with (. <= iv <= .)
        genarray( drop([-1],shape(X1)), ((:complex)((:double[+])X1)[iv]) + X2);
  return(res);
}
int main()
{
  a = (:complex[+])(with (. <= iv <= .) genarray([4,3,2], 1d));
  print(a+((:complex)[1d,2d]));
  return(dim(a));
}
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking