File: misc.rst

package info (click to toggle)
neuron 8.2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,768 kB
  • sloc: cpp: 149,571; python: 58,449; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (57 lines) | stat: -rw-r--r-- 1,475 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Obsolete Pointer Functions
==========================


.. hoc:function:: this_node


    Syntax:
        ``this_node(x)``


    Description:
        Return a pointer (coded as a double) to the segment 
        of the currently accessed section that 
        contains location *x*. If you wish to compute a segment number 
        index where 1 is the first nonzero area segment and nseg is the last 
        nonzero area segment 
        of the currently accessed section corresponding to position x use the 
        hoc function 

        .. code-block::
            none

            func segnum() { 
                    if ($1 <= 0) { 
                            return 0 
                    }else if ($1 >= 1) { 
                            return nseg+1 
                    }else { 
                            return int($1*nseg + .5) 
                    } 
            } 


    .. warning::
        This function is useless and should be removed. 

----



.. hoc:function:: this_section


    Syntax:
        ``this_section(x)``


    Description:
        Return a pointer (coded as a double) to the section which contains location 0 of the 
        currently accessed section. This pointer can be used as the argument 
        to :hoc:func:`push_section`. Functions that return pointers coded as doubles
        are unsafe with 64 bit pointers. This function has been superseded by 
        :hoc:class:`SectionRef`. See :hoc:meth:`~SectionRef.sec`.