File: utils.asy

package info (click to toggle)
hipblas 5.5.1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 14,352 kB
  • sloc: cpp: 114,952; f90: 26,193; python: 4,618; sh: 954; ansic: 628; makefile: 45; xml: 23
file content (24 lines) | stat: -rwxr-xr-x 526 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Find the comma-separated strings to use in the legend
string[] set_legends(string runlegs)
{
   string[] legends;
   bool myleg=((runlegs== "") ? false: true);
   bool flag=true;
   int n=-1;
   int lastpos=0;
   string legends[];
   if(myleg) {
      string runleg;
      while(flag) {
	 ++n;
	 int pos=find(runlegs,",",lastpos);
	 if(lastpos == -1) {runleg=""; flag=false;}

	 runleg=substr(runlegs,lastpos,pos-lastpos);

	 lastpos=pos > 0 ? pos+1 : -1;
	 if(flag) legends.push(runleg);
      }
   }
   return legends;
}