├── .dokx ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── complex.lua ├── conv.c ├── convolution.lua ├── doc ├── _highlight │ ├── LICENSE │ ├── README.md │ ├── classref.txt │ ├── highlight.pack.js │ └── styles │ │ ├── arta.css │ │ ├── ascetic.css │ │ ├── brown_paper.css │ │ ├── brown_papersq.png │ │ ├── dark.css │ │ ├── default.css │ │ ├── docco.css │ │ ├── far.css │ │ ├── foundation.css │ │ ├── github.css │ │ ├── googlecode.css │ │ ├── idea.css │ │ ├── ir_black.css │ │ ├── magula.css │ │ ├── mono-blue.css │ │ ├── monokai.css │ │ ├── monokai_sublime.css │ │ ├── obsidian.css │ │ ├── pojoaque.css │ │ ├── pojoaque.jpg │ │ ├── railscasts.css │ │ ├── rainbow.css │ │ ├── school_book.css │ │ ├── school_book.png │ │ ├── solarized_dark.css │ │ ├── solarized_light.css │ │ ├── sunburst.css │ │ ├── tomorrow-night-blue.css │ │ ├── tomorrow-night-bright.css │ │ ├── tomorrow-night-eighties.css │ │ ├── tomorrow-night.css │ │ ├── tomorrow.css │ │ ├── vs.css │ │ ├── xcode.css │ │ └── zenburn.css ├── _markdown │ └── signal │ │ ├── README.md │ │ ├── complex.md │ │ ├── convolution.md │ │ ├── extramath.md │ │ ├── ffi.md │ │ ├── fft.md │ │ ├── init.md │ │ └── wavelet.md ├── index.html ├── search.js ├── signal │ ├── complex.html │ ├── convolution.html │ ├── extra │ │ └── README.html │ ├── extramath.html │ ├── ffi.html │ ├── fft.html │ ├── index.html │ ├── init.html │ ├── style.css │ └── wavelet.html ├── style-page.css └── style.css ├── extramath.lua ├── ffi.lua ├── fft.lua ├── init.c ├── init.lua ├── rocks └── signal-scm-1.rockspec ├── tests ├── cceps.lua ├── dct.lua ├── fft.lua ├── fftM.lua ├── hilbert.lua ├── poly.lua ├── rceps.lua ├── rcunwrap.lua ├── rcwrap.lua ├── rfftM.lua ├── stft.lua ├── test.lua ├── unwrap.lua └── wavelet.lua └── wavelet.lua /.dokx: -------------------------------------------------------------------------------- 1 | return { 2 | packageName = 'signal', 3 | includeLocal = false, 4 | githubURL = 'soumith/torch-signal' 5 | 6 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *~ 3 | \#* 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR) 2 | CMAKE_POLICY(VERSION 2.6) 3 | IF(LUAROCKS_PREFIX) 4 | MESSAGE(STATUS "Installing Torch-Signal through Luarocks") 5 | STRING(REGEX REPLACE "(.*)lib/luarocks/rocks.*" "\\1" CMAKE_INSTALL_PREFIX "${LUAROCKS_PREFIX}") 6 | MESSAGE(STATUS "Prefix inferred from Luarocks: ${CMAKE_INSTALL_PREFIX}") 7 | ENDIF() 8 | FIND_PACKAGE(Torch REQUIRED) 9 | 10 | FILE(GLOB luasrc *.lua) 11 | #FILE(GLOB src *.c) 12 | SET(src "init.c") 13 | ADD_TORCH_PACKAGE(signal "${src}" "${luasrc}" "Signal Processing Toolbox") 14 | 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Soumith Chintala 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, this 11 | list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | * Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # torch-signal 2 | A signal processing toolbox for Torch-7 3 | 4 | - Fourier Transforms (real & complex) (1D, 2D, 3D) 5 | - Cosine Transforms (1D, 2D, 3D) 6 | - Short-time Fourier Transforms 7 | - Spectrogram 8 | - Hilbert Transform 9 | - Complex Cepstral Analysis, Real Cepstrums 10 | 11 | 12 | ## Quickstart 13 | Install fftw3 on your OS: 14 | 15 | OSX (Homebrew): 16 | ```bash 17 | brew install fftw 18 | ``` 19 | 20 | Ubuntu: 21 | ```bash 22 | sudo apt-get install libfftw3 23 | OR 24 | sudo apt-get install libfftw3-3 25 | ``` 26 | 27 | Install torch-signal: 28 | ```bash 29 | luarocks install https://raw.github.com/soumith/torch-signal/master/rocks/signal-scm-1.rockspec 30 | ``` 31 | 32 | (add sudo for ubuntu) 33 | 34 | For documentation, go to: 35 | http://soumith.github.io/torch-signal/signal/ 36 | 37 | For examples, see tests/ 38 | -------------------------------------------------------------------------------- /complex.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | All functions in here expect either a 2D Nx2 Complex tensor 3 | ]]-- 4 | 5 | local complex = {} 6 | 7 | function complex.angle(h) 8 | return torch.atan2(h[{{},2}],h[{{},1}]) 9 | end 10 | 11 | function complex.exp(h) 12 | local out = h:clone() 13 | local real = h[{{},1}] 14 | local imag = h[{{},2}] 15 | out[{{},1}] = torch.exp(real):cmul(torch.cos(imag)) 16 | out[{{},2}] = torch.exp(real):cmul(torch.sin(imag)); 17 | return out 18 | end 19 | 20 | function complex.abs(h) 21 | local hsquare = torch.pow(h,2) 22 | if h:dim() == 2 and h:size(2) == 2 then 23 | return torch.sqrt(hsquare[{{},1}] + hsquare[{{},2}]) 24 | elseif h:dim() == 3 and h:size(3) == 2 then 25 | return torch.sqrt(hsquare[{{},{},1}] + hsquare[{{},{},2}]) 26 | else 27 | error('unsupported dimensions') 28 | end 29 | end 30 | 31 | function complex.real(h) 32 | return h[{{},1}] 33 | end 34 | 35 | function complex.imag(h) 36 | return h[{{},2}] 37 | end 38 | 39 | function complex.conj(h) 40 | local out = h:clone() 41 | out[{{},2}]:mul(-1) 42 | return out 43 | end 44 | 45 | function complex.prod(h) 46 | local out = torch.ones(1,2):typeAs(h) 47 | out[1] = h[1] 48 | for i=2,h:size(1) do 49 | -- (x1 + iy1) * (x2 + iy2) = (x1x2 - y1y2) + i(x1y2 + y1x2) 50 | local real = (out[1][1]* h[i][1] - out[1][2] * h[i][2]) 51 | local imag = (out[1][1]* h[i][2] + out[1][2] * h[i][1]) 52 | out[1][1] = real 53 | out[1][2] = imag 54 | end 55 | return out 56 | end 57 | 58 | function complex.cmul(a1,b1, noargcheck) 59 | local a,b 60 | if noargcheck then 61 | a=a1; b=b1 62 | else 63 | if a1:dim() == 1 then -- assume that imag is 0 64 | a = torch.DoubleTensor(a1:size(1), 2):zero() 65 | a[{{}, 1}] = a1 66 | elseif a1:dim() == 2 and a1:size(2) == 2 then 67 | a = a1 68 | else 69 | error('Input has to be 1D Tensor of size N (purely real 1D tensor) or ' .. 70 | '2D Tensor of size Nx2 (Complex 1D tensor)') 71 | end 72 | if b1:dim() == 1 then -- assume that imag is 0 73 | b = torch.DoubleTensor(b1:size(1), 2):zero() 74 | b[{{}, 1}] = b1 75 | elseif b1:dim() == 2 and b1:size(2) == 2 then 76 | b = b1 77 | else 78 | error('Input has to be 1D Tensor of size N (purely real 1D tensor) or ' .. 79 | '2D Tensor of size Nx2 (Complex 1D tensor)') 80 | end 81 | end 82 | local c = a:clone():zero() 83 | a = a:contiguous() 84 | b = b:contiguous() 85 | c = c:contiguous() 86 | local cd = torch.data(c) 87 | local ad = torch.data(a) 88 | local bd = torch.data(b) 89 | for i=0,a:size(1)-1 do 90 | -- (x1 + iy1) * (x2 + iy2) = (x1x2 - y1y2) + i(x1y2 + y1x2) 91 | local re = i*2 92 | local im = i*2 + 1 93 | cd[re] = (ad[re]* bd[re] - ad[im] * bd[im]) 94 | cd[im] = (ad[re]* bd[im] + ad[im] * bd[re]) 95 | end 96 | return c 97 | end 98 | 99 | function complex.dot(a,b) 100 | if not(a:dim() == 2 and a:size(2) == 2 and b:dim() == 2 and b:size(2) == 2) then 101 | error('Inputs have to be 2D Tensor of size Nx2 (complex 1D tensor)') 102 | end 103 | if a:size(1) ~= b:size(1) then 104 | error('Both inputs need to have same number of elements') 105 | end 106 | local c = torch.sum(complex.cmul(a,b, true), 1) 107 | return c 108 | end 109 | 110 | function complex.mm(a,b) 111 | if not(a:dim() == 3 and a:size(3) == 2 and b:dim() == 3 and b:size(3) == 2) then 112 | error('Inputs have to be 3D Tensor of size NxMx2 (complex 2D tensor)') 113 | end 114 | if a:size(2) ~= b:size(1) then 115 | error('Matrix-Matrix product requires NxM and MxP matrices.') 116 | end 117 | local c = torch.zeros(a:size(1), b:size(2), 2):typeAs(a) 118 | for i=1,c:size(1) do 119 | for j=1,c:size(2) do 120 | c[i][j] = complex.dot(a[{i,{},{}}], b[{{},j,{}}]) 121 | -- print(c[i][j]) 122 | end 123 | end 124 | return c 125 | end 126 | 127 | function complex.diag(x) 128 | if x:dim() == 2 and x:size(2) == 2 then 129 | local y = torch.zeros(x:size(1), x:size(1), 2) 130 | y[{{},1}] = torch.diag(x[{{},1}]) 131 | y[{{},2}] = torch.diag(x[{{},2}]) 132 | return y 133 | elseif x:dim() == 3 and x:size(3) == 2 then 134 | local yr = torch.diag(x[{{},{},1}]) 135 | local y = torch.zeros(yr:size(1),2) 136 | y[{{},1}] = yr 137 | y[{{},2}] = torch.diag(x[{{},{},2}]) 138 | return y 139 | else 140 | error('Input has to be 2D Tensor of size Nx2 or ' .. 141 | '3D Tensor of size NxMx2 (Complex 2D tensor)') 142 | end 143 | end 144 | 145 | --[[ 146 | Polynomial with specified roots 147 | 148 | Function is super unoptimized 149 | ]]-- 150 | function complex.poly(x) 151 | local e 152 | if x:dim() == 2 and x:size(1) == x:size(2) then 153 | e = torch.eig(x) -- square polynomial 154 | -- TODO: Strip out infinities in case the eigen values have any 155 | elseif x:dim() == 1 then 156 | e = x 157 | else 158 | error('Input should be a 1D Tensor or a 2D square tensor') 159 | end 160 | 161 | -- Expand recursion formula 162 | local n = e:size(1) 163 | if x:dim() == 1 then 164 | local c = torch.zeros(n+1) -- purely real 165 | c[1] = 1 166 | for j=1,n do 167 | c[{{2,(j+1)}}] = c[{{2,(j+1)}}] - torch.mul(c[{{1,j}}],e[j]) 168 | end 169 | return c 170 | else 171 | local c = torch.zeros(n+1,2) -- complex 172 | c[1][1] = 1 173 | for j=1,n do 174 | -- c(2:(j+1)) = c(2:(j+1)) - e(j).*c(1:j); 175 | c[{{2,(j+1)}, 1}] = c[{{2,(j+1)}, 1}] - torch.mul(c[{{1,j}, 1}],e[j][1]) 176 | c[{{2,(j+1)}, 2}] = c[{{2,(j+1)}, 2}] - torch.mul(c[{{1,j}, 2}],e[j][2]) 177 | end 178 | -- The result should be real if the roots are complex conjugates. 179 | local c1 = torch.sort(e[{{torch.ge(e[{{},2}], 0)},2}]) 180 | local c2 = torch.sort(e[{{torch.le(e[{{},2}], 0)},2}]) 181 | if c1:size(1) == c2:size(1) and torch.eq(c1, c2):sum() == c1:size(1) then 182 | c = complex.real(c); 183 | end 184 | return c 185 | end 186 | end 187 | 188 | return complex 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /conv.c: -------------------------------------------------------------------------------- 1 | /* conv1d with a stride option. only does valid convolutions 2 | accumulates in y 3 | y is output , yn is output size 4 | x is input 5 | k is kernel, kn is kernel size 6 | stride is convolution stride 7 | */ 8 | void signal_(conv1d)(real *y, real *x, real *k, const long yn, const long kn, long stride) { 9 | long yi, ki; 10 | for (yi = 0; yi < yn; ++yi) { 11 | real * xi = x + yi * stride; 12 | for (ki = 0; ki < kn; ++ki) 13 | y[yi] += xi[ki] * k[ki]; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /convolution.lua: -------------------------------------------------------------------------------- 1 | local signal = {} 2 | local C = require 'signal.ffi' 3 | 4 | --[[ 5 | 1D valid convolution with stride 6 | ]]-- 7 | function signal.conv1d(input, kernel, stride, mode) 8 | kernel = kernel:typeAs(input) 9 | local input_data = input:data() 10 | local kernel_data = kernel:data() 11 | 12 | local input_size = input:size(1) 13 | local kernel_size = kernel:size(1) 14 | 15 | mode = mode or 'valid' 16 | local output_size = 0 17 | if mode == 'valid' then 18 | output_size = math.floor((input_size - kernel_size + stride)/stride) 19 | elseif mode == 'same' then 20 | output_size = math.floor(math.max(input_size/stride, kernel_size/stride)) 21 | else 22 | error("Supported modes are 'valid' or 'same'") 23 | end 24 | local output = torch.zeros(output_size):typeAs(input) 25 | local output_data = output:data() 26 | 27 | if input:type() == 'torch.FloatTensor' then 28 | C['signal_conv1d_float'](output_data, input_data, kernel_data, output_size, kernel_size, stride) 29 | else 30 | C['signal_conv1d_double'](output_data, input_data, kernel_data, output_size, kernel_size, stride) 31 | end 32 | return output 33 | end 34 | 35 | return signal 36 | -------------------------------------------------------------------------------- /doc/_highlight/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Ivan Sagalaev 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of highlight.js nor the names of its contributors 12 | may be used to endorse or promote products derived from this software 13 | without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /doc/_highlight/README.md: -------------------------------------------------------------------------------- 1 | # Highlight.js 2 | 3 | Highlight.js highlights syntax in code examples on blogs, forums and, 4 | in fact, on any web page. It's very easy to use because it works 5 | automatically: finds blocks of code, detects a language, highlights it. 6 | 7 | Autodetection can be fine tuned when it fails by itself (see "Heuristics"). 8 | 9 | 10 | ## Basic usage 11 | 12 | Link the library and a stylesheet from your page and hook highlighting to 13 | the page load event: 14 | 15 | ```html 16 | 17 | 18 | 19 | ``` 20 | 21 | This will highlight all code on the page marked up as `
 .. 
`. 22 | If you use different markup or need to apply highlighting dynamically, read 23 | "Custom initialization" below. 24 | 25 | - You can download your own customized version of "highlight.pack.js" or 26 | use the hosted one as described on the download page: 27 | 28 | 29 | - Style themes are available in the download package or as hosted files. 30 | To create a custom style for your site see the class reference in the file 31 | [classref.txt][cr] from the downloaded package. 32 | 33 | [cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt 34 | 35 | 36 | ## node.js 37 | 38 | Highlight.js can be used under node.js. The package with all supported languages is 39 | installable from NPM: 40 | 41 | npm install highlight.js 42 | 43 | Alternatively, you can build it from the source with only languages you need: 44 | 45 | python3 tools/build.py -tnode lang1 lang2 .. 46 | 47 | Using the library: 48 | 49 | ```javascript 50 | var hljs = require('highlight.js'); 51 | 52 | // If you know the language 53 | hljs.highlight(lang, code).value; 54 | 55 | // Automatic language detection 56 | hljs.highlightAuto(code).value; 57 | ``` 58 | 59 | 60 | ## AMD 61 | 62 | Highlight.js can be used with an AMD loader. You will need to build it from 63 | source in order to do so: 64 | 65 | ```bash 66 | $ python3 tools/build.py -tamd lang1 lang2 .. 67 | ``` 68 | 69 | Which will generate a `build/highlight.pack.js` which will load as an AMD 70 | module with support for the built languages and can be used like so: 71 | 72 | ```javascript 73 | require(["highlight.js/build/highlight.pack"], function(hljs){ 74 | 75 | // If you know the language 76 | hljs.highlight(lang, code).value; 77 | 78 | // Automatic language detection 79 | hljs.highlightAuto(code).value; 80 | }); 81 | ``` 82 | 83 | 84 | ## Tab replacement 85 | 86 | You can replace TAB ('\x09') characters used for indentation in your code 87 | with some fixed number of spaces or with a `` to give them special 88 | styling: 89 | 90 | ```html 91 | 98 | ``` 99 | 100 | ## Custom initialization 101 | 102 | If you use different markup for code blocks you can initialize them manually 103 | with `highlightBlock(code, tabReplace, useBR)` function. It takes a DOM element 104 | containing the code to highlight and optionally a string with which to replace 105 | TAB characters. 106 | 107 | Initialization using, for example, jQuery might look like this: 108 | 109 | ```javascript 110 | $(document).ready(function() { 111 | $('pre code').each(function(i, e) {hljs.highlightBlock(e)}); 112 | }); 113 | ``` 114 | 115 | You can use `highlightBlock` to highlight blocks dynamically inserted into 116 | the page. Just make sure you don't do it twice for already highlighted 117 | blocks. 118 | 119 | If your code container relies on `
` tags instead of line breaks (i.e. if 120 | it's not `
`) pass `true` into the third parameter of `highlightBlock`
121 | to make highlight.js use `
` in the output: 122 | 123 | ```javascript 124 | $('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)}); 125 | ``` 126 | 127 | 128 | ## Heuristics 129 | 130 | Autodetection of a code's language is done using a simple heuristic: 131 | the program tries to highlight a fragment with all available languages and 132 | counts all syntactic structures that it finds along the way. The language 133 | with greatest count wins. 134 | 135 | This means that in short fragments the probability of an error is high 136 | (and it really happens sometimes). In this cases you can set the fragment's 137 | language explicitly by assigning a class to the `` element: 138 | 139 | ```html 140 |
...
141 | ``` 142 | 143 | You can use class names recommended in HTML5: "language-html", 144 | "language-php". Classes also can be assigned to the `
` element.
145 | 
146 | To disable highlighting of a fragment altogether use "no-highlight" class:
147 | 
148 | ```html
149 | 
...
150 | ``` 151 | 152 | 153 | ## Export 154 | 155 | File export.html contains a little program that allows you to paste in a code 156 | snippet and then copy and paste the resulting HTML code generated by the 157 | highlighter. This is useful in situations when you can't use the script itself 158 | on a site. 159 | 160 | 161 | ## Meta 162 | 163 | - Version: 7.5 164 | - URL: http://highlightjs.org/ 165 | 166 | For the license terms see LICENSE files. 167 | For authors and contributors see AUTHORS.en.txt file. 168 | -------------------------------------------------------------------------------- /doc/_highlight/classref.txt: -------------------------------------------------------------------------------- 1 | This is a full list of available classes corresponding to languages' 2 | syntactic structures. The parentheses after language name contain identifiers 3 | used as class names in `` element. 4 | 5 | Python ("python"): 6 | 7 | keyword keyword 8 | built_in built-in objects (None, False, True and Ellipsis) 9 | number number 10 | string string (of any type) 11 | comment comment 12 | decorator @-decorator for functions 13 | function function header "def some_name(...):" 14 | class class header "class SomeName(...):" 15 | title name of a function or a class inside a header 16 | params everything inside parentheses in a function's or class' header 17 | 18 | Python profiler results ("profile"): 19 | 20 | number number 21 | string string 22 | built_in built-in function entry 23 | filename filename in an entry 24 | summary profiling summary 25 | header header of table of results 26 | keyword column header 27 | function function name in an entry (including parentheses) 28 | title actual name of a function in an entry (excluding parentheses) 29 | prompt interpreter prompt (>>> or ...) 30 | 31 | Ruby ("ruby"): 32 | 33 | keyword keyword 34 | string string 35 | subst in-string substitution (#{...}) 36 | comment comment 37 | yardoctag YARD tag 38 | function function header "def some_name(...):" 39 | class class header "class SomeName(...):" 40 | title name of a function or a class inside a header 41 | parent name of a parent class 42 | symbol symbol 43 | 44 | Haml ("haml"): 45 | 46 | tag any tag starting with "%" 47 | title tag's name 48 | attribute tag's attribute 49 | keyword tag's attribute that is a keyword 50 | string attribute's value that is a string 51 | value attribute's value, shorthand id or class for tag 52 | comment comment 53 | doctype !!! declaration 54 | bullet line defined by variable 55 | 56 | Perl ("perl"): 57 | 58 | keyword keyword 59 | comment comment 60 | number number 61 | string string 62 | regexp regular expression 63 | sub subroutine header (from "sub" till "{") 64 | variable variable starting with "$", "%", "@" 65 | operator operator 66 | pod plain old doc 67 | 68 | PHP ("php"): 69 | 70 | keyword keyword 71 | number number 72 | string string (of any type) 73 | comment comment 74 | phpdoc phpdoc params in comments 75 | variable variable starting with "$" 76 | preprocessor preprocessor marks: "" 77 | 78 | Scala ("scala"): 79 | 80 | keyword keyword 81 | number number 82 | string string 83 | comment comment 84 | annotation annotation 85 | javadoc javadoc comment 86 | javadoctag @-tag in javadoc 87 | class class header 88 | title class name inside a header 89 | params everything in parentheses inside a class header 90 | inheritance keywords "extends" and "with" inside class header 91 | 92 | Go ("go"): 93 | 94 | comment comment 95 | string string constant 96 | number number 97 | keyword language keywords 98 | constant true false nil iota 99 | typename built-in plain types (int, string etc.) 100 | built_in built-in functions 101 | 102 | HTML, XML ("xml"): 103 | 104 | tag any tag from "<" till ">" 105 | attribute tag's attribute with or without value 106 | value attribute's value 107 | comment comment 108 | pi processing instruction () 109 | doctype declaration 110 | cdata CDATA section 111 | 112 | Lasso ("lasso"): 113 | 114 | preprocessor delimiters and interpreter flags 115 | shebang Lasso 9 shell script header 116 | comment single- or multi-line comment 117 | javadoc doc comment 118 | keyword keyword 119 | literal keyword representing a value 120 | built_in built-in types and variables 121 | number number 122 | string string 123 | variable variable reference starting with "#" or "$" 124 | tag tag literal 125 | attribute named or rest parameter in method signature 126 | class type, trait, or method header 127 | title name following "define" inside a header 128 | 129 | CSS ("css"): 130 | 131 | tag tag in selectors 132 | id #some_name in selectors 133 | class .some_name in selectors 134 | at_rule @-rule till first "{" or ";" 135 | attr_selector attribute selector (square brackets in a[href^=http://]) 136 | pseudo pseudo classes and elemens (:after, ::after etc.) 137 | comment comment 138 | rules everything from "{" till "}" 139 | attribute property name inside a rule 140 | value property value inside a rule, from ":" till ";" or 141 | till the end of rule block 142 | number number within a value 143 | string string within a value 144 | hexcolor hex color (#FFFFFF) within a value 145 | function CSS function within a value 146 | important "!important" symbol 147 | 148 | SCSS ("scss"): 149 | 150 | tag tag in selectors 151 | id #some_name in selectors 152 | class .some_name in selectors 153 | at_rule @-rule till first "{" or ";" 154 | attr_selector attribute selector (square brackets in a[href^=http://]) 155 | pseudo pseudo classes and elemens (:after, ::after etc.) 156 | comment comment 157 | rules everything from "{" till "}" 158 | attribute property name inside a rule 159 | value property value inside a rule, from ":" till ";" or 160 | till the end of rule block 161 | number number within a value 162 | string string within a value 163 | hexcolor hex color (#FFFFFF) within a value 164 | function CSS function within a value 165 | important "!important" symbol 166 | variable variable starting with "$" 167 | preprocessor keywords after @ 168 | 169 | Markdown ("markdown"): 170 | 171 | header header 172 | bullet list bullet 173 | emphasis emphasis 174 | strong strong emphasis 175 | blockquote blockquote 176 | code code 177 | horizontal_rule horizontal rule 178 | link_label link label 179 | link_url link url 180 | 181 | AsciiDoc ("asciidoc"): 182 | 183 | header heading 184 | bullet list or labeled bullet 185 | emphasis emphasis 186 | strong strong emphasis 187 | blockquote blockquote 188 | code inline or block code 189 | horizontal_rule horizontal rule 190 | link_label link or image label 191 | link_url link or image url 192 | comment comment 193 | attribute document attribute, block attributes 194 | label admonition label 195 | 196 | Django ("django"): 197 | 198 | keyword HTML tag in HTML, default tags and default filters in templates 199 | tag any tag from "<" till ">" 200 | comment comment 201 | doctype declaration 202 | attribute tag's attribute with or withou value 203 | value attribute's value 204 | template_tag template tag {% .. %} 205 | variable template variable {{ .. }} 206 | template_comment template comment, both {# .. #} and {% comment %} 207 | filter filter from "|" till the next filter or the end of tag 208 | argument filter argument 209 | 210 | Handlebars ("handlebars"): 211 | 212 | expression expression to be evaluated 213 | variable variable 214 | begin-block the beginning of a block 215 | end-block the ending of a block 216 | string string 217 | 218 | JSON ("json"): 219 | 220 | number number 221 | literal "true", "false" and "null" 222 | string string value 223 | attribute name of an object property 224 | value value of an object property 225 | 226 | JavaScript ("javascript"): 227 | 228 | keyword keyword 229 | comment comment 230 | number number 231 | literal special literal: "true", "false" and "null" 232 | string string 233 | regexp regular expression 234 | function header of a function 235 | title name of a function inside a header 236 | params parentheses and everything inside them in a function's header 237 | 238 | CoffeeScript ("coffeescript"): 239 | 240 | keyword keyword 241 | comment comment 242 | number number 243 | literal special literal: "true", "false" and "null" 244 | built_in built-in objects and functions ("window", "console", "require", etc...) 245 | string string 246 | subst #{ ... } interpolation in double-quoted strings 247 | regexp regular expression 248 | function header of a function 249 | class header of a class 250 | title name of a function variable inside a header 251 | params parentheses and everything inside them in a function's header 252 | property @-property within class and functions 253 | 254 | ActionScript ("actionscript"): 255 | 256 | comment comment 257 | string string 258 | number number 259 | keyword keywords 260 | literal literal 261 | reserved reserved keyword 262 | title name of declaration (package, class or function) 263 | preprocessor preprocessor directive (import, include) 264 | type type of returned value (for functions) 265 | package package (named or not) 266 | class class/interface 267 | function function 268 | param params of function 269 | rest_arg rest argument of function 270 | 271 | VBScript ("vbscript"): 272 | 273 | keyword keyword 274 | number number 275 | string string 276 | comment comment 277 | built_in built-in function 278 | 279 | VB.Net ("vbnet"): 280 | 281 | keyword keyword 282 | built_in built-in types 283 | literal "true", "false" and "nothing" 284 | string string 285 | comment comment 286 | xmlDocTag xmldoc tag ("'''", "", "<..>") 287 | preprocessor preprocessor directive 288 | 289 | HTTP ("http"): 290 | 291 | request first line of a request 292 | status first line of a response 293 | attribute header name 294 | string header value or query string in a request line 295 | number status code 296 | 297 | Lua ("lua"): 298 | 299 | keyword keyword 300 | number number 301 | string string 302 | comment comment 303 | built_in built-in operator 304 | function header of a function 305 | title name of a function inside a header 306 | params everything inside parentheses in a function's header 307 | long_brackets multiline string in [=[ .. ]=] 308 | 309 | Delphi ("delphi"): 310 | 311 | keyword keyword 312 | comment comment (of any type) 313 | number number 314 | string string 315 | function header of a function, procedure, constructor and destructor 316 | title name of a function, procedure, constructor or destructor 317 | inside a header 318 | params everything inside parentheses in a function's header 319 | class class' body from "= class" till "end;" 320 | 321 | Java ("java"): 322 | 323 | keyword keyword 324 | number number 325 | string string 326 | comment commment 327 | annotaion annotation 328 | javadoc javadoc comment 329 | class class header from "class" till "{" 330 | title class name inside a header 331 | params everything in parentheses inside a class header 332 | inheritance keywords "extends" and "implements" inside class header 333 | 334 | C++ ("cpp"): 335 | 336 | keyword keyword 337 | number number 338 | string string and character 339 | comment comment 340 | preprocessor preprocessor directive 341 | stl_container instantiation of STL containers ("vector<...>") 342 | 343 | Objective C ("objectivec"): 344 | 345 | keyword keyword 346 | built_in Cocoa/Cocoa Touch constants and classes 347 | number number 348 | string string 349 | comment comment 350 | preprocessor preprocessor directive 351 | class interface/implementation, protocol and forward class declaration 352 | variable properties and struct accesors 353 | 354 | Vala ("vala"): 355 | 356 | keyword keyword 357 | number number 358 | string string 359 | comment comment 360 | class class definitions 361 | title in class definition 362 | constant ALL_UPPER_CASE 363 | 364 | C# ("cs"): 365 | 366 | keyword keyword 367 | number number 368 | string string 369 | comment commment 370 | xmlDocTag xmldoc tag ("///", "", "<..>") 371 | 372 | F# ("fsharp"): 373 | 374 | keywords keyword 375 | number number 376 | string string 377 | commment comment 378 | class any custom F# type 379 | title the name of a custom F# type 380 | annotation any attribute 381 | 382 | OCaml ("ocaml"): 383 | keywords keyword 384 | number number 385 | string string 386 | commment comment 387 | class any custom OCaml type 388 | title the name of a custom OCaml type 389 | annotation any attribute 390 | 391 | D ("d"): 392 | 393 | comment comment 394 | string string constant 395 | number number 396 | keyword language keywords (including @attributes) 397 | constant true false null 398 | built_in built-in plain types (int, string etc.) 399 | 400 | RenderMan RSL ("rsl"): 401 | 402 | keyword keyword 403 | number number 404 | string string (including @"..") 405 | comment comment 406 | preprocessor preprocessor directive 407 | shader sahder keywords 408 | shading shading keywords 409 | built_in built-in function 410 | 411 | RenderMan RIB ("rib"): 412 | 413 | keyword keyword 414 | number number 415 | string string 416 | comment comment 417 | commands command 418 | 419 | Maya Embedded Language ("mel"): 420 | 421 | keyword keyword 422 | number number 423 | string string 424 | comment comment 425 | variable variable 426 | 427 | SQL ("sql"): 428 | 429 | keyword keyword (mostly SQL'92 and SQL'99) 430 | number number 431 | string string (of any type: "..", '..', `..`) 432 | comment comment 433 | aggregate aggregate function 434 | 435 | Smalltalk ("smalltalk"): 436 | 437 | keyword keyword 438 | number number 439 | string string 440 | comment commment 441 | symbol symbol 442 | array array 443 | class name of a class 444 | char char 445 | localvars block of local variables 446 | 447 | Lisp ("lisp"): 448 | 449 | keyword keyword 450 | number number 451 | string string 452 | comment commment 453 | variable variable 454 | literal b, t and nil 455 | list non-quoted list 456 | title first symbol in a non-quoted list 457 | body remainder of the non-quoted list 458 | quoted quoted list, both "(quote .. )" and "'(..)" 459 | 460 | Clojure ("clojure"): 461 | 462 | comment comments and hints 463 | string string 464 | number number 465 | collection collections 466 | attribute :keyword 467 | title function name (built-in or user defined) 468 | built_in built-in function name 469 | 470 | Ini ("ini"): 471 | 472 | title title of a section 473 | value value of a setting of any type 474 | string string 475 | number number 476 | keyword boolean value keyword 477 | 478 | Apache ("apache"): 479 | 480 | keyword keyword 481 | number number 482 | comment commment 483 | literal On and Off 484 | sqbracket variables in rewrites "%{..}" 485 | cbracket options in rewrites "[..]" 486 | tag begin and end of a configuration section 487 | 488 | Nginx ("nginx"): 489 | 490 | title directive title 491 | string string 492 | number number 493 | comment comment 494 | built_in built-in constant 495 | variable $-variable 496 | regexp regexp 497 | 498 | Diff ("diff"): 499 | 500 | header file header 501 | chunk chunk header within a file 502 | addition added lines 503 | deletion deleted lines 504 | change changed lines 505 | 506 | DOS ("dos"): 507 | 508 | keyword keyword 509 | flow batch control keyword 510 | stream DOS special files ("con", "prn", ...) 511 | winutils some commands (see dos.js specifically) 512 | envvar environment variables 513 | 514 | Bash ("bash"): 515 | 516 | keyword keyword 517 | string string 518 | number number 519 | comment comment 520 | literal special literal: "true" и "false" 521 | variable variable 522 | shebang script interpreter header 523 | 524 | Makefile ("makefile"): 525 | 526 | keyword keyword ".PHONY" within the phony line 527 | string string 528 | comment comment 529 | variable $(..) variable 530 | title target title 531 | constant constant within the initial definition 532 | 533 | CMake ("cmake"): 534 | 535 | keyword keyword 536 | number number 537 | string string 538 | comment commment 539 | envvar $-variable 540 | operator operator (LESS, STREQUAL, MATCHES, etc) 541 | 542 | Axapta ("axapta"): 543 | 544 | keyword keyword 545 | number number 546 | string string 547 | comment commment 548 | class class header from "class" till "{" 549 | title class name inside a header 550 | params everything in parentheses inside a class header 551 | inheritance keywords "extends" and "implements" inside class header 552 | preprocessor preprocessor directive 553 | 554 | Oracle Rules Language ("ruleslanguage"): 555 | 556 | comment comment 557 | string string constant 558 | number number 559 | keyword language keywords 560 | built_in built-in functions 561 | array array stem 562 | 563 | 1C ("1c"): 564 | 565 | keyword keyword 566 | number number 567 | date date 568 | string string 569 | comment commment 570 | function header of function or procudure 571 | title function name inside a header 572 | params everything in parentheses inside a function header 573 | preprocessor preprocessor directive 574 | 575 | AVR assembler ("avrasm"): 576 | 577 | keyword keyword 578 | built_in pre-defined register 579 | number number 580 | string string 581 | comment commment 582 | label label 583 | preprocessor preprocessor directive 584 | localvars substitution in .macro 585 | 586 | VHDL ("vhdl"): 587 | 588 | keyword keyword 589 | number number 590 | string string 591 | comment commment 592 | literal signal logical value 593 | typename typename 594 | attribute signal attribute 595 | 596 | Parser3 ("parser3"): 597 | 598 | keyword keyword 599 | number number 600 | comment commment 601 | variable variable starting with "$" 602 | preprocessor preprocessor directive 603 | title user-defined name starting with "@" 604 | 605 | LiveCode Server ("livecodeserver"): 606 | 607 | variable variable starting with "g", "t", "p", "s", "$_" 608 | string string 609 | comment comment 610 | number number 611 | title name of a command or a function 612 | keyword keyword 613 | constant constant 614 | operator operator 615 | built_in built_in functions and commands 616 | function header of a function 617 | command header of a command 618 | preprocessor preprocessor marks: "" 619 | 620 | TeX ("tex"): 621 | 622 | comment comment 623 | number number 624 | command command 625 | parameter parameter 626 | formula formula 627 | special special symbol 628 | 629 | Haskell ("haskell"): 630 | 631 | comment comment 632 | pragma GHC pragma 633 | preprocessor CPP preprocessor directive 634 | keyword keyword 635 | number number 636 | string string 637 | title function or variable name 638 | type value, type or type class constructor name (i.e. capitalized) 639 | container (..., ...) or {...; ...} list in declaration or record 640 | module module declaration 641 | import import declaration 642 | class type class or instance declaration 643 | typedef type declaration (type, newtype, data) 644 | default default declaration 645 | infix infix declaration 646 | foreign FFI declaration 647 | shebang shebang line 648 | 649 | Erlang ("erlang"): 650 | 651 | comment comment 652 | string string 653 | number number 654 | keyword keyword 655 | record_name record access (#record_name) 656 | title name of declaration function 657 | variable variable (starts with capital letter or with _) 658 | pp.keywords module's attribute (-attribute) 659 | function_name atom or atom:atom in case of function call 660 | 661 | Rust ("rust"): 662 | 663 | comment comment 664 | string string 665 | number number 666 | keyword keyword 667 | title name of declaration 668 | preprocessor preprocessor directive 669 | 670 | Matlab ("matlab"): 671 | 672 | comment comment 673 | string string 674 | number number 675 | keyword keyword 676 | title function name 677 | function function 678 | param params of function 679 | matrix matrix in [ .. ] 680 | cell cell in { .. } 681 | 682 | Scilab ("scilab"): 683 | 684 | comment comment 685 | string string 686 | number number 687 | keyword keyword 688 | title function name 689 | function function 690 | param params of function 691 | matrix matrix in [ .. ] 692 | 693 | R ("r"): 694 | 695 | comment comment 696 | string string constant 697 | number number 698 | keyword language keywords (function, if) plus "structural" 699 | functions (attach, require, setClass) 700 | literal special literal: TRUE, FALSE, NULL, NA, etc. 701 | 702 | OpenGL Shading Language ("glsl"): 703 | 704 | comment comment 705 | number number 706 | preprocessor preprocessor directive 707 | keyword keyword 708 | built_in GLSL built-in functions and variables 709 | literal true false 710 | 711 | AppleScript ("applescript"): 712 | 713 | keyword keyword 714 | command core AppleScript command 715 | constant AppleScript built in constant 716 | type AppleScript variable type (integer, etc.) 717 | property Applescript built in property (length, etc.) 718 | number number 719 | string string 720 | comment comment 721 | title name of a handler 722 | 723 | Brainfuck ("brainfuck"): 724 | 725 | title Brainfuck while loop command 726 | literal Brainfuck inc and dec commands 727 | comment comment 728 | string Brainfuck input and output commands 729 | 730 | Mizar ("mizar"): 731 | 732 | keyword keyword 733 | comment comment 734 | -------------------------------------------------------------------------------- /doc/_highlight/highlight.pack.js: -------------------------------------------------------------------------------- 1 | var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(//gm,">")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName.toUpperCase()=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName.toUpperCase()=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+(q.parentNode?q.parentNode.className:"")).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o"}function x(z){y+=""}function o(z){(z.event=="start"?t:x)(z.node)}while(p.length||r.length){var w=u();y+=l(v.substr(q,w[0].offset-q));q=w[0].offset;if(w==p){s.reverse().forEach(x);do{o(w.splice(0,1)[0]);w=u()}while(w==p&&w.length&&w[0].offset==q);s.reverse().forEach(t)}else{if(w[0].event=="start"){s.push(w[0].node)}else{s.pop()}o(w.splice(0,1)[0])}}return y+l(v.substr(q))}function f(r){function o(s){return(s&&s.source)||s}function p(t,s){return RegExp(o(t),"m"+(r.cI?"i":"")+(s?"g":""))}function q(z,x){if(z.compiled){return}z.compiled=true;var u=[];if(z.k){var s={};function A(B,t){if(r.cI){t=t.toLowerCase()}t.split(" ").forEach(function(C){var D=C.split("|");s[D[0]]=[B,D[1]?Number(D[1]):1];u.push(D[0])})}z.lR=p(z.l||"\\b"+hljs.IR+"\\b(?!\\.)",true);if(typeof z.k=="string"){A("keyword",z.k)}else{for(var y in z.k){if(!z.k.hasOwnProperty(y)){continue}A(y,z.k[y])}}z.k=s}if(x){if(z.bWK){z.b="\\b("+u.join("|")+")\\b(?!\\.)\\s*"}z.bR=p(z.b?z.b:"\\B|\\b");if(!z.e&&!z.eW){z.e="\\B|\\b"}if(z.e){z.eR=p(z.e)}z.tE=o(z.e)||"";if(z.eW&&x.tE){z.tE+=(z.e?"|":"")+x.tE}}if(z.i){z.iR=p(z.i)}if(z.r===undefined){z.r=1}if(!z.c){z.c=[]}for(var w=0;w'+O[0]+""}else{r+=O[0]}Q=B.lR.lastIndex;O=B.lR.exec(N)}return r+N.substr(Q)}function z(){if(B.sL&&!e[B.sL]){return l(w)}var N=B.subLanguageMode=="continuous"?B.top:undefined;var r=B.sL?d(B.sL,w,true,N):g(w);if(B.r>0){v+=r.keyword_count;A+=r.r}B.top=r.top;return''+r.value+""}function L(){return B.sL!==undefined?z():I()}function K(O,r){var N=O.cN?'':"";if(O.rB){x+=N;w=""}else{if(O.eB){x+=l(r)+N;w=""}else{x+=N;w=r}}B=Object.create(O,{parent:{value:B}})}function D(N,r){w+=N;if(r===undefined){x+=L();return 0}var P=o(r,B);if(P){x+=L();K(P,r);return P.rB?0:r.length}var Q=s(B,r);if(Q){var O=B;if(!(O.rE||O.eE)){w+=r}x+=L();do{if(B.cN){x+=""}A+=B.r;B=B.parent}while(B!=Q.parent);if(O.eE){x+=l(r)}w="";if(Q.starts){K(Q.starts,"")}return O.rE?0:r.length}if(t(r,B)){throw new Error('Illegal lexem "'+r+'" for mode "'+(B.cN||"")+'"')}w+=r;return r.length||1}var H=e[E];if(!H){throw new Error('Unknown language: "'+E+'"')}f(H);var B=M||H;var x="";for(var F=B;F!=H;F=F.parent){if(F.cN){x=''+x}}var w="";var A=0;var v=0;try{var u,q,p=0;while(true){B.t.lastIndex=p;u=B.t.exec(G);if(!u){break}q=D(G.substr(p,u.index-p),u[0]);p=u.index+q}D(G.substr(p));for(var F=B;F.parent;F=F.parent){if(F.cN){x+=""}}return{r:A,keyword_count:v,value:x,language:E,top:B}}catch(J){if(J.message.indexOf("Illegal")!=-1){return{r:0,keyword_count:0,value:l(G)}}else{throw J}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s,false);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"
")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v,true):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElementNS("http://www.w3.org/1999/xhtml","pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml","pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.lua=function(b){var a="\\[=*\\[";var e="\\]=*\\]";var c={b:a,e:e,c:["self"]};var d=[{cN:"comment",b:"--(?!"+a+")",e:"$"},{cN:"comment",b:"--"+a,e:e,c:[c],r:10}];return{l:b.UIR,k:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},c:d.concat([{cN:"function",bWK:true,e:"\\)",k:"function",c:[{cN:"title",b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"},{cN:"params",b:"\\(",eW:true,c:d}].concat(d)},b.CNM,b.ASM,b.QSM,{cN:"string",b:a,e:e,c:[c],r:10}])}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,r:0,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[b],starts:{e:"",rE:true,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"",r:0,c:[{cN:"title",b:"[^ /><]+"},b]}]}}(hljs);hljs.LANGUAGES.markdown=function(a){return{c:[{cN:"header",b:"^#{1,3}",e:"$"},{cN:"header",b:"^.+?\\n[=-]{2,}$"},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",b:"\\*.+?\\*"},{cN:"emphasis",b:"_.+?_",r:0},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",b:"`.+?`"},{cN:"code",b:"^ ",e:"$",r:0},{cN:"horizontal_rule",b:"^-{3,}",e:"$"},{b:"\\[.+?\\]\\(.+?\\)",rB:true,c:[{cN:"link_label",b:"\\[.+\\]"},{cN:"link_url",b:"\\(",e:"\\)",eB:true,eE:true}]}]}}(hljs);hljs.LANGUAGES.python=function(a){var f={cN:"prompt",b:/^(>>>|\.\.\.) /};var c=[{cN:"string",b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{cN:"string",b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{cN:"string",b:/(u|r|ur)'/,e:/'/,c:[a.BE],r:10},{cN:"string",b:/(u|r|ur)"/,e:/"/,c:[a.BE],r:10},{cN:"string",b:/(b|br)'/,e:/'/,c:[a.BE]},{cN:"string",b:/(b|br)"/,e:/"/,c:[a.BE]}].concat([a.ASM,a.QSM]);var e={cN:"title",b:a.UIR};var d={cN:"params",b:/\(/,e:/\)/,c:["self",a.CNM,f].concat(c)};var b={bWK:true,e:/:/,i:/[${=;\n]/,c:[e,d],r:10};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:c.concat([f,a.HCM,a.inherit(b,{cN:"function",k:"def"}),a.inherit(b,{cN:"class",k:"class"}),a.CNM,{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}])}}(hljs);hljs.LANGUAGES.tex=function(a){var d={cN:"command",b:"\\\\[a-zA-Zа-яА-я]+[\\*]?"};var c={cN:"command",b:"\\\\[^a-zA-Zа-яА-я0-9]"};var b={cN:"special",b:"[{}\\[\\]\\&#~]",r:0};return{c:[{b:"\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",rB:true,c:[d,c,{cN:"number",b:" *=",e:"-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",eB:true}],r:10},d,c,b,{cN:"formula",b:"\\$\\$",e:"\\$\\$",c:[d,c,b],r:0},{cN:"formula",b:"\\$",e:"\\$",c:[d,c,b],r:0},{cN:"comment",b:"%",e:"$",r:0}]}}(hljs);hljs.LANGUAGES.r=function(a){var b="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[a.HCM,{b:b,l:b,k:{keyword:"function if in break next repeat else for return switch while try tryCatch|10 stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...|10",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",b:'"',e:'"',c:[a.BE],r:0},{cN:"string",b:"'",e:"'",c:[a.BE],r:0}]}}(hljs);hljs.LANGUAGES.cpp=function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr"};return{k:b,i:"",i:"\\n"},a.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,r:10,c:["self"]}]}}(hljs); -------------------------------------------------------------------------------- /doc/_highlight/styles/arta.css: -------------------------------------------------------------------------------- 1 | /* 2 | Date: 17.V.2011 3 | Author: pumbur 4 | */ 5 | 6 | pre code 7 | { 8 | display: block; padding: 0.5em; 9 | background: #222; 10 | } 11 | 12 | pre .profile .header *, 13 | pre .ini .title, 14 | pre .nginx .title 15 | { 16 | color: #fff; 17 | } 18 | 19 | pre .comment, 20 | pre .javadoc, 21 | pre .preprocessor, 22 | pre .preprocessor .title, 23 | pre .pragma, 24 | pre .shebang, 25 | pre .profile .summary, 26 | pre .diff, 27 | pre .pi, 28 | pre .doctype, 29 | pre .tag, 30 | pre .template_comment, 31 | pre .css .rules, 32 | pre .tex .special 33 | { 34 | color: #444; 35 | } 36 | 37 | pre .string, 38 | pre .symbol, 39 | pre .diff .change, 40 | pre .regexp, 41 | pre .xml .attribute, 42 | pre .smalltalk .char, 43 | pre .xml .value, 44 | pre .ini .value, 45 | pre .clojure .attribute, 46 | pre .coffeescript .attribute 47 | { 48 | color: #ffcc33; 49 | } 50 | 51 | pre .number, 52 | pre .addition 53 | { 54 | color: #00cc66; 55 | } 56 | 57 | pre .built_in, 58 | pre .literal, 59 | pre .vhdl .typename, 60 | pre .go .constant, 61 | pre .go .typename, 62 | pre .ini .keyword, 63 | pre .lua .title, 64 | pre .perl .variable, 65 | pre .php .variable, 66 | pre .mel .variable, 67 | pre .django .variable, 68 | pre .css .funtion, 69 | pre .smalltalk .method, 70 | pre .hexcolor, 71 | pre .important, 72 | pre .flow, 73 | pre .inheritance, 74 | pre .parser3 .variable 75 | { 76 | color: #32AAEE; 77 | } 78 | 79 | pre .keyword, 80 | pre .tag .title, 81 | pre .css .tag, 82 | pre .css .class, 83 | pre .css .id, 84 | pre .css .pseudo, 85 | pre .css .attr_selector, 86 | pre .lisp .title, 87 | pre .clojure .built_in, 88 | pre .winutils, 89 | pre .tex .command, 90 | pre .request, 91 | pre .status 92 | { 93 | color: #6644aa; 94 | } 95 | 96 | pre .title, 97 | pre .ruby .constant, 98 | pre .vala .constant, 99 | pre .parent, 100 | pre .deletion, 101 | pre .template_tag, 102 | pre .css .keyword, 103 | pre .objectivec .class .id, 104 | pre .smalltalk .class, 105 | pre .lisp .keyword, 106 | pre .apache .tag, 107 | pre .nginx .variable, 108 | pre .envvar, 109 | pre .bash .variable, 110 | pre .go .built_in, 111 | pre .vbscript .built_in, 112 | pre .lua .built_in, 113 | pre .rsl .built_in, 114 | pre .tail, 115 | pre .avrasm .label, 116 | pre .tex .formula, 117 | pre .tex .formula * 118 | { 119 | color: #bb1166; 120 | } 121 | 122 | pre .yardoctag, 123 | pre .phpdoc, 124 | pre .profile .header, 125 | pre .ini .title, 126 | pre .apache .tag, 127 | pre .parser3 .title 128 | { 129 | font-weight: bold; 130 | } 131 | 132 | pre .coffeescript .javascript, 133 | pre .javascript .xml, 134 | pre .tex .formula, 135 | pre .xml .javascript, 136 | pre .xml .vbscript, 137 | pre .xml .css, 138 | pre .xml .cdata 139 | { 140 | opacity: 0.6; 141 | } 142 | 143 | pre code, 144 | pre .javascript, 145 | pre .css, 146 | pre .xml, 147 | pre .subst, 148 | pre .diff .chunk, 149 | pre .css .value, 150 | pre .css .attribute, 151 | pre .lisp .string, 152 | pre .lisp .number, 153 | pre .tail .params, 154 | pre .container, 155 | pre .haskell *, 156 | pre .erlang *, 157 | pre .erlang_repl * 158 | { 159 | color: #aaa; 160 | } 161 | -------------------------------------------------------------------------------- /doc/_highlight/styles/ascetic.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: white; color: black; 10 | } 11 | 12 | pre .string, 13 | pre .tag .value, 14 | pre .filter .argument, 15 | pre .addition, 16 | pre .change, 17 | pre .apache .tag, 18 | pre .apache .cbracket, 19 | pre .nginx .built_in, 20 | pre .tex .formula { 21 | color: #888; 22 | } 23 | 24 | pre .comment, 25 | pre .template_comment, 26 | pre .shebang, 27 | pre .doctype, 28 | pre .pi, 29 | pre .javadoc, 30 | pre .deletion, 31 | pre .apache .sqbracket { 32 | color: #CCC; 33 | } 34 | 35 | pre .keyword, 36 | pre .tag .title, 37 | pre .ini .title, 38 | pre .lisp .title, 39 | pre .clojure .title, 40 | pre .http .title, 41 | pre .nginx .title, 42 | pre .css .tag, 43 | pre .winutils, 44 | pre .flow, 45 | pre .apache .tag, 46 | pre .tex .command, 47 | pre .request, 48 | pre .status { 49 | font-weight: bold; 50 | } 51 | -------------------------------------------------------------------------------- /doc/_highlight/styles/brown_paper.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Brown Paper style from goldblog.com.ua (c) Zaripov Yura 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background:#b7a68e url(./brown_papersq.png); 10 | } 11 | 12 | pre .keyword, 13 | pre .literal, 14 | pre .change, 15 | pre .winutils, 16 | pre .flow, 17 | pre .lisp .title, 18 | pre .clojure .built_in, 19 | pre .nginx .title, 20 | pre .tex .special, 21 | pre .request, 22 | pre .status { 23 | color:#005599; 24 | font-weight:bold; 25 | } 26 | 27 | pre code, 28 | pre .subst, 29 | pre .tag .keyword { 30 | color: #363C69; 31 | } 32 | 33 | pre .string, 34 | pre .title, 35 | pre .haskell .type, 36 | pre .tag .value, 37 | pre .css .rules .value, 38 | pre .preprocessor, 39 | pre .pragma, 40 | pre .ruby .symbol, 41 | pre .ruby .symbol .string, 42 | pre .ruby .class .parent, 43 | pre .built_in, 44 | pre .sql .aggregate, 45 | pre .django .template_tag, 46 | pre .django .variable, 47 | pre .smalltalk .class, 48 | pre .javadoc, 49 | pre .ruby .string, 50 | pre .django .filter .argument, 51 | pre .smalltalk .localvars, 52 | pre .smalltalk .array, 53 | pre .attr_selector, 54 | pre .pseudo, 55 | pre .addition, 56 | pre .stream, 57 | pre .envvar, 58 | pre .apache .tag, 59 | pre .apache .cbracket, 60 | pre .tex .number { 61 | color: #2C009F; 62 | } 63 | 64 | pre .comment, 65 | pre .java .annotation, 66 | pre .python .decorator, 67 | pre .template_comment, 68 | pre .pi, 69 | pre .doctype, 70 | pre .deletion, 71 | pre .shebang, 72 | pre .apache .sqbracket, 73 | pre .nginx .built_in, 74 | pre .tex .formula { 75 | color: #802022; 76 | } 77 | 78 | pre .keyword, 79 | pre .literal, 80 | pre .css .id, 81 | pre .phpdoc, 82 | pre .title, 83 | pre .haskell .type, 84 | pre .vbscript .built_in, 85 | pre .sql .aggregate, 86 | pre .rsl .built_in, 87 | pre .smalltalk .class, 88 | pre .diff .header, 89 | pre .chunk, 90 | pre .winutils, 91 | pre .bash .variable, 92 | pre .apache .tag, 93 | pre .tex .command { 94 | font-weight: bold; 95 | } 96 | 97 | pre .coffeescript .javascript, 98 | pre .javascript .xml, 99 | pre .tex .formula, 100 | pre .xml .javascript, 101 | pre .xml .vbscript, 102 | pre .xml .css, 103 | pre .xml .cdata { 104 | opacity: 0.8; 105 | } 106 | -------------------------------------------------------------------------------- /doc/_highlight/styles/brown_papersq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soumith/torch-signal/14479a9c1bf70f90a5267ed5aa30a34e1a9effd3/doc/_highlight/styles/brown_papersq.png -------------------------------------------------------------------------------- /doc/_highlight/styles/dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Dark style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #444; 10 | } 11 | 12 | pre .keyword, 13 | pre .literal, 14 | pre .change, 15 | pre .winutils, 16 | pre .flow, 17 | pre .lisp .title, 18 | pre .clojure .built_in, 19 | pre .nginx .title, 20 | pre .tex .special { 21 | color: white; 22 | } 23 | 24 | pre code, 25 | pre .subst { 26 | color: #DDD; 27 | } 28 | 29 | pre .string, 30 | pre .title, 31 | pre .haskell .type, 32 | pre .ini .title, 33 | pre .tag .value, 34 | pre .css .rules .value, 35 | pre .preprocessor, 36 | pre .pragma, 37 | pre .ruby .symbol, 38 | pre .ruby .symbol .string, 39 | pre .ruby .class .parent, 40 | pre .built_in, 41 | pre .sql .aggregate, 42 | pre .django .template_tag, 43 | pre .django .variable, 44 | pre .smalltalk .class, 45 | pre .javadoc, 46 | pre .ruby .string, 47 | pre .django .filter .argument, 48 | pre .smalltalk .localvars, 49 | pre .smalltalk .array, 50 | pre .attr_selector, 51 | pre .pseudo, 52 | pre .addition, 53 | pre .stream, 54 | pre .envvar, 55 | pre .apache .tag, 56 | pre .apache .cbracket, 57 | pre .tex .command, 58 | pre .prompt, 59 | pre .coffeescript .attribute { 60 | color: #D88; 61 | } 62 | 63 | pre .comment, 64 | pre .java .annotation, 65 | pre .python .decorator, 66 | pre .template_comment, 67 | pre .pi, 68 | pre .doctype, 69 | pre .deletion, 70 | pre .shebang, 71 | pre .apache .sqbracket, 72 | pre .tex .formula { 73 | color: #777; 74 | } 75 | 76 | pre .keyword, 77 | pre .literal, 78 | pre .title, 79 | pre .css .id, 80 | pre .phpdoc, 81 | pre .haskell .type, 82 | pre .vbscript .built_in, 83 | pre .sql .aggregate, 84 | pre .rsl .built_in, 85 | pre .smalltalk .class, 86 | pre .diff .header, 87 | pre .chunk, 88 | pre .winutils, 89 | pre .bash .variable, 90 | pre .apache .tag, 91 | pre .tex .special, 92 | pre .request, 93 | pre .status { 94 | font-weight: bold; 95 | } 96 | 97 | pre .coffeescript .javascript, 98 | pre .javascript .xml, 99 | pre .tex .formula, 100 | pre .xml .javascript, 101 | pre .xml .vbscript, 102 | pre .xml .css, 103 | pre .xml .cdata { 104 | opacity: 0.5; 105 | } 106 | -------------------------------------------------------------------------------- /doc/_highlight/styles/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #F0F0F0; 10 | } 11 | 12 | pre code, 13 | pre .subst, 14 | pre .tag .title, 15 | pre .lisp .title, 16 | pre .clojure .built_in, 17 | pre .nginx .title { 18 | color: black; 19 | } 20 | 21 | pre .string, 22 | pre .title, 23 | pre .constant, 24 | pre .parent, 25 | pre .tag .value, 26 | pre .rules .value, 27 | pre .rules .value .number, 28 | pre .preprocessor, 29 | pre .pragma, 30 | pre .haml .symbol, 31 | pre .ruby .symbol, 32 | pre .ruby .symbol .string, 33 | pre .aggregate, 34 | pre .template_tag, 35 | pre .django .variable, 36 | pre .smalltalk .class, 37 | pre .addition, 38 | pre .flow, 39 | pre .stream, 40 | pre .bash .variable, 41 | pre .apache .tag, 42 | pre .apache .cbracket, 43 | pre .tex .command, 44 | pre .tex .special, 45 | pre .erlang_repl .function_or_atom, 46 | pre .asciidoc .header, 47 | pre .markdown .header, 48 | pre .coffeescript .attribute { 49 | color: #800; 50 | } 51 | 52 | pre .smartquote, 53 | pre .comment, 54 | pre .annotation, 55 | pre .template_comment, 56 | pre .diff .header, 57 | pre .chunk, 58 | pre .asciidoc .blockquote, 59 | pre .markdown .blockquote { 60 | color: #888; 61 | } 62 | 63 | pre .number, 64 | pre .date, 65 | pre .regexp, 66 | pre .literal, 67 | pre .hexcolor, 68 | pre .smalltalk .symbol, 69 | pre .smalltalk .char, 70 | pre .go .constant, 71 | pre .change, 72 | pre .lasso .variable, 73 | pre .makefile .variable, 74 | pre .asciidoc .bullet, 75 | pre .markdown .bullet, 76 | pre .asciidoc .link_url, 77 | pre .markdown .link_url { 78 | color: #080; 79 | } 80 | 81 | pre .label, 82 | pre .javadoc, 83 | pre .ruby .string, 84 | pre .decorator, 85 | pre .filter .argument, 86 | pre .localvars, 87 | pre .array, 88 | pre .attr_selector, 89 | pre .important, 90 | pre .pseudo, 91 | pre .pi, 92 | pre .haml .bullet, 93 | pre .doctype, 94 | pre .deletion, 95 | pre .envvar, 96 | pre .shebang, 97 | pre .apache .sqbracket, 98 | pre .nginx .built_in, 99 | pre .tex .formula, 100 | pre .erlang_repl .reserved, 101 | pre .prompt, 102 | pre .asciidoc .link_label, 103 | pre .markdown .link_label, 104 | pre .vhdl .attribute, 105 | pre .clojure .attribute, 106 | pre .asciidoc .attribute, 107 | pre .lasso .attribute, 108 | pre .coffeescript .property, 109 | pre .makefile .phony { 110 | color: #88F 111 | } 112 | 113 | pre .keyword, 114 | pre .id, 115 | pre .title, 116 | pre .built_in, 117 | pre .aggregate, 118 | pre .css .tag, 119 | pre .javadoctag, 120 | pre .phpdoc, 121 | pre .yardoctag, 122 | pre .smalltalk .class, 123 | pre .winutils, 124 | pre .bash .variable, 125 | pre .apache .tag, 126 | pre .go .typename, 127 | pre .tex .command, 128 | pre .asciidoc .strong, 129 | pre .markdown .strong, 130 | pre .request, 131 | pre .status { 132 | font-weight: bold; 133 | } 134 | 135 | pre .asciidoc .emphasis, 136 | pre .markdown .emphasis { 137 | font-style: italic; 138 | } 139 | 140 | pre .nginx .built_in { 141 | font-weight: normal; 142 | } 143 | 144 | pre .coffeescript .javascript, 145 | pre .javascript .xml, 146 | pre .lasso .markup, 147 | pre .tex .formula, 148 | pre .xml .javascript, 149 | pre .xml .vbscript, 150 | pre .xml .css, 151 | pre .xml .cdata { 152 | opacity: 0.5; 153 | } 154 | -------------------------------------------------------------------------------- /doc/_highlight/styles/docco.css: -------------------------------------------------------------------------------- 1 | /* 2 | Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars) 3 | */ 4 | 5 | pre code { 6 | display: block; padding: 0.5em; 7 | color: #000; 8 | background: #f8f8ff 9 | } 10 | 11 | pre .comment, 12 | pre .template_comment, 13 | pre .diff .header, 14 | pre .javadoc { 15 | color: #408080; 16 | font-style: italic 17 | } 18 | 19 | pre .keyword, 20 | pre .assignment, 21 | pre .literal, 22 | pre .css .rule .keyword, 23 | pre .winutils, 24 | pre .javascript .title, 25 | pre .lisp .title, 26 | pre .subst { 27 | color: #954121; 28 | } 29 | 30 | pre .number, 31 | pre .hexcolor { 32 | color: #40a070 33 | } 34 | 35 | pre .string, 36 | pre .tag .value, 37 | pre .phpdoc, 38 | pre .tex .formula { 39 | color: #219161; 40 | } 41 | 42 | pre .title, 43 | pre .id { 44 | color: #19469D; 45 | } 46 | pre .params { 47 | color: #00F; 48 | } 49 | 50 | pre .javascript .title, 51 | pre .lisp .title, 52 | pre .subst { 53 | font-weight: normal 54 | } 55 | 56 | pre .class .title, 57 | pre .haskell .label, 58 | pre .tex .command { 59 | color: #458; 60 | font-weight: bold 61 | } 62 | 63 | pre .tag, 64 | pre .tag .title, 65 | pre .rules .property, 66 | pre .django .tag .keyword { 67 | color: #000080; 68 | font-weight: normal 69 | } 70 | 71 | pre .attribute, 72 | pre .variable, 73 | pre .instancevar, 74 | pre .lisp .body { 75 | color: #008080 76 | } 77 | 78 | pre .regexp { 79 | color: #B68 80 | } 81 | 82 | pre .class { 83 | color: #458; 84 | font-weight: bold 85 | } 86 | 87 | pre .symbol, 88 | pre .ruby .symbol .string, 89 | pre .ruby .symbol .keyword, 90 | pre .ruby .symbol .keymethods, 91 | pre .lisp .keyword, 92 | pre .tex .special, 93 | pre .input_number { 94 | color: #990073 95 | } 96 | 97 | pre .builtin, 98 | pre .constructor, 99 | pre .built_in, 100 | pre .lisp .title { 101 | color: #0086b3 102 | } 103 | 104 | pre .preprocessor, 105 | pre .pragma, 106 | pre .pi, 107 | pre .doctype, 108 | pre .shebang, 109 | pre .cdata { 110 | color: #999; 111 | font-weight: bold 112 | } 113 | 114 | pre .deletion { 115 | background: #fdd 116 | } 117 | 118 | pre .addition { 119 | background: #dfd 120 | } 121 | 122 | pre .diff .change { 123 | background: #0086b3 124 | } 125 | 126 | pre .chunk { 127 | color: #aaa 128 | } 129 | 130 | pre .tex .formula { 131 | opacity: 0.5; 132 | } 133 | -------------------------------------------------------------------------------- /doc/_highlight/styles/far.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | FAR Style (c) MajestiC 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #000080; 10 | } 11 | 12 | pre code, 13 | pre .subst { 14 | color: #0FF; 15 | } 16 | 17 | pre .string, 18 | pre .ruby .string, 19 | pre .haskell .type, 20 | pre .tag .value, 21 | pre .css .rules .value, 22 | pre .css .rules .value .number, 23 | pre .preprocessor, 24 | pre .pragma, 25 | pre .ruby .symbol, 26 | pre .ruby .symbol .string, 27 | pre .built_in, 28 | pre .sql .aggregate, 29 | pre .django .template_tag, 30 | pre .django .variable, 31 | pre .smalltalk .class, 32 | pre .addition, 33 | pre .apache .tag, 34 | pre .apache .cbracket, 35 | pre .tex .command, 36 | pre .clojure .title, 37 | pre .coffeescript .attribute { 38 | color: #FF0; 39 | } 40 | 41 | pre .keyword, 42 | pre .css .id, 43 | pre .title, 44 | pre .haskell .type, 45 | pre .vbscript .built_in, 46 | pre .sql .aggregate, 47 | pre .rsl .built_in, 48 | pre .smalltalk .class, 49 | pre .xml .tag .title, 50 | pre .winutils, 51 | pre .flow, 52 | pre .change, 53 | pre .envvar, 54 | pre .bash .variable, 55 | pre .tex .special, 56 | pre .clojure .built_in { 57 | color: #FFF; 58 | } 59 | 60 | pre .comment, 61 | pre .phpdoc, 62 | pre .javadoc, 63 | pre .java .annotation, 64 | pre .template_comment, 65 | pre .deletion, 66 | pre .apache .sqbracket, 67 | pre .tex .formula { 68 | color: #888; 69 | } 70 | 71 | pre .number, 72 | pre .date, 73 | pre .regexp, 74 | pre .literal, 75 | pre .smalltalk .symbol, 76 | pre .smalltalk .char, 77 | pre .clojure .attribute { 78 | color: #0F0; 79 | } 80 | 81 | pre .python .decorator, 82 | pre .django .filter .argument, 83 | pre .smalltalk .localvars, 84 | pre .smalltalk .array, 85 | pre .attr_selector, 86 | pre .pseudo, 87 | pre .xml .pi, 88 | pre .diff .header, 89 | pre .chunk, 90 | pre .shebang, 91 | pre .nginx .built_in, 92 | pre .prompt { 93 | color: #008080; 94 | } 95 | 96 | pre .keyword, 97 | pre .css .id, 98 | pre .title, 99 | pre .haskell .type, 100 | pre .vbscript .built_in, 101 | pre .sql .aggregate, 102 | pre .rsl .built_in, 103 | pre .smalltalk .class, 104 | pre .winutils, 105 | pre .flow, 106 | pre .apache .tag, 107 | pre .nginx .built_in, 108 | pre .tex .command, 109 | pre .tex .special, 110 | pre .request, 111 | pre .status { 112 | font-weight: bold; 113 | } 114 | -------------------------------------------------------------------------------- /doc/_highlight/styles/foundation.css: -------------------------------------------------------------------------------- 1 | /* 2 | Description: Foundation 4 docs style for highlight.js 3 | Author: Dan Allen 4 | Website: http://foundation.zurb.com/docs/ 5 | Version: 1.0 6 | Date: 2013-04-02 7 | */ 8 | 9 | pre code { 10 | display: block; padding: 0.5em; 11 | background: #eee; 12 | } 13 | 14 | pre .header, 15 | pre .decorator, 16 | pre .annotation { 17 | color: #000077; 18 | } 19 | 20 | pre .horizontal_rule, 21 | pre .link_url, 22 | pre .emphasis, 23 | pre .attribute { 24 | color: #070; 25 | } 26 | 27 | pre .emphasis { 28 | font-style: italic; 29 | } 30 | 31 | pre .link_label, 32 | pre .strong, 33 | pre .value, 34 | pre .string, 35 | pre .scss .value .string { 36 | color: #d14; 37 | } 38 | 39 | pre .strong { 40 | font-weight: bold; 41 | } 42 | 43 | pre .blockquote, 44 | pre .comment { 45 | color: #998; 46 | font-style: italic; 47 | } 48 | 49 | pre .asciidoc .title, 50 | pre .function .title { 51 | color: #900; 52 | } 53 | 54 | pre .class { 55 | color: #458; 56 | } 57 | 58 | pre .id, 59 | pre .pseudo, 60 | pre .constant, 61 | pre .hexcolor { 62 | color: teal; 63 | } 64 | 65 | pre .variable { 66 | color: #336699; 67 | } 68 | 69 | pre .bullet, 70 | pre .javadoc { 71 | color: #997700; 72 | } 73 | 74 | pre .pi, 75 | pre .doctype { 76 | color: #3344bb; 77 | } 78 | 79 | pre .code, 80 | pre .number { 81 | color: #099; 82 | } 83 | 84 | pre .important { 85 | color: #f00; 86 | } 87 | 88 | pre .smartquote, 89 | pre .label { 90 | color: #970; 91 | } 92 | 93 | pre .preprocessor, 94 | pre .pragma { 95 | color: #579; 96 | } 97 | 98 | pre .reserved, 99 | pre .keyword, 100 | pre .scss .value { 101 | color: #000; 102 | } 103 | 104 | pre .regexp { 105 | background-color: #fff0ff; 106 | color: #880088; 107 | } 108 | 109 | pre .symbol { 110 | color: #990073; 111 | } 112 | 113 | pre .symbol .string { 114 | color: #a60; 115 | } 116 | 117 | pre .tag { 118 | color: #007700; 119 | } 120 | 121 | pre .at_rule, 122 | pre .at_rule .keyword { 123 | color: #088; 124 | } 125 | 126 | pre .at_rule .preprocessor { 127 | color: #808; 128 | } 129 | 130 | pre .scss .tag, 131 | pre .scss .attribute { 132 | color: #339; 133 | } 134 | -------------------------------------------------------------------------------- /doc/_highlight/styles/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | 8 | pre code { 9 | display: block; padding: 0.5em; 10 | color: #333; 11 | background: #f8f8ff 12 | } 13 | 14 | pre .comment, 15 | pre .template_comment, 16 | pre .diff .header, 17 | pre .javadoc { 18 | color: #998; 19 | font-style: italic 20 | } 21 | 22 | pre .keyword, 23 | pre .css .rule .keyword, 24 | pre .winutils, 25 | pre .javascript .title, 26 | pre .nginx .title, 27 | pre .subst, 28 | pre .request, 29 | pre .status { 30 | color: #333; 31 | font-weight: bold 32 | } 33 | 34 | pre .number, 35 | pre .hexcolor, 36 | pre .ruby .constant { 37 | color: #099; 38 | } 39 | 40 | pre .string, 41 | pre .tag .value, 42 | pre .phpdoc, 43 | pre .tex .formula { 44 | color: #d14 45 | } 46 | 47 | pre .title, 48 | pre .id, 49 | pre .coffeescript .params, 50 | pre .scss .preprocessor { 51 | color: #900; 52 | font-weight: bold 53 | } 54 | 55 | pre .javascript .title, 56 | pre .lisp .title, 57 | pre .clojure .title, 58 | pre .subst { 59 | font-weight: normal 60 | } 61 | 62 | pre .class .title, 63 | pre .haskell .type, 64 | pre .vhdl .literal, 65 | pre .tex .command { 66 | color: #458; 67 | font-weight: bold 68 | } 69 | 70 | pre .tag, 71 | pre .tag .title, 72 | pre .rules .property, 73 | pre .django .tag .keyword { 74 | color: #000080; 75 | font-weight: normal 76 | } 77 | 78 | pre .attribute, 79 | pre .variable, 80 | pre .lisp .body { 81 | color: #008080 82 | } 83 | 84 | pre .regexp { 85 | color: #009926 86 | } 87 | 88 | pre .class { 89 | color: #458; 90 | font-weight: bold 91 | } 92 | 93 | pre .symbol, 94 | pre .ruby .symbol .string, 95 | pre .lisp .keyword, 96 | pre .tex .special, 97 | pre .prompt { 98 | color: #990073 99 | } 100 | 101 | pre .built_in, 102 | pre .lisp .title, 103 | pre .clojure .built_in { 104 | color: #0086b3 105 | } 106 | 107 | pre .preprocessor, 108 | pre .pragma, 109 | pre .pi, 110 | pre .doctype, 111 | pre .shebang, 112 | pre .cdata { 113 | color: #999; 114 | font-weight: bold 115 | } 116 | 117 | pre .deletion { 118 | background: #fdd 119 | } 120 | 121 | pre .addition { 122 | background: #dfd 123 | } 124 | 125 | pre .diff .change { 126 | background: #0086b3 127 | } 128 | 129 | pre .chunk { 130 | color: #aaa 131 | } 132 | -------------------------------------------------------------------------------- /doc/_highlight/styles/googlecode.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Google Code style (c) Aahan Krish 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: white; color: black; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .javadoc, 15 | pre .comment * { 16 | color: #800; 17 | } 18 | 19 | pre .keyword, 20 | pre .method, 21 | pre .list .title, 22 | pre .clojure .built_in, 23 | pre .nginx .title, 24 | pre .tag .title, 25 | pre .setting .value, 26 | pre .winutils, 27 | pre .tex .command, 28 | pre .http .title, 29 | pre .request, 30 | pre .status { 31 | color: #008; 32 | } 33 | 34 | pre .envvar, 35 | pre .tex .special { 36 | color: #660; 37 | } 38 | 39 | pre .string, 40 | pre .tag .value, 41 | pre .cdata, 42 | pre .filter .argument, 43 | pre .attr_selector, 44 | pre .apache .cbracket, 45 | pre .date, 46 | pre .regexp, 47 | pre .coffeescript .attribute { 48 | color: #080; 49 | } 50 | 51 | pre .sub .identifier, 52 | pre .pi, 53 | pre .tag, 54 | pre .tag .keyword, 55 | pre .decorator, 56 | pre .ini .title, 57 | pre .shebang, 58 | pre .prompt, 59 | pre .hexcolor, 60 | pre .rules .value, 61 | pre .css .value .number, 62 | pre .literal, 63 | pre .symbol, 64 | pre .ruby .symbol .string, 65 | pre .number, 66 | pre .css .function, 67 | pre .clojure .attribute { 68 | color: #066; 69 | } 70 | 71 | pre .class .title, 72 | pre .haskell .type, 73 | pre .smalltalk .class, 74 | pre .javadoctag, 75 | pre .yardoctag, 76 | pre .phpdoc, 77 | pre .typename, 78 | pre .tag .attribute, 79 | pre .doctype, 80 | pre .class .id, 81 | pre .built_in, 82 | pre .setting, 83 | pre .params, 84 | pre .variable, 85 | pre .clojure .title { 86 | color: #606; 87 | } 88 | 89 | pre .css .tag, 90 | pre .rules .property, 91 | pre .pseudo, 92 | pre .subst { 93 | color: #000; 94 | } 95 | 96 | pre .css .class, pre .css .id { 97 | color: #9B703F; 98 | } 99 | 100 | pre .value .important { 101 | color: #ff7700; 102 | font-weight: bold; 103 | } 104 | 105 | pre .rules .keyword { 106 | color: #C5AF75; 107 | } 108 | 109 | pre .annotation, 110 | pre .apache .sqbracket, 111 | pre .nginx .built_in { 112 | color: #9B859D; 113 | } 114 | 115 | pre .preprocessor, 116 | pre .preprocessor *, 117 | pre .pragma { 118 | color: #444; 119 | } 120 | 121 | pre .tex .formula { 122 | background-color: #EEE; 123 | font-style: italic; 124 | } 125 | 126 | pre .diff .header, 127 | pre .chunk { 128 | color: #808080; 129 | font-weight: bold; 130 | } 131 | 132 | pre .diff .change { 133 | background-color: #BCCFF9; 134 | } 135 | 136 | pre .addition { 137 | background-color: #BAEEBA; 138 | } 139 | 140 | pre .deletion { 141 | background-color: #FFC8BD; 142 | } 143 | 144 | pre .comment .yardoctag { 145 | font-weight: bold; 146 | } 147 | -------------------------------------------------------------------------------- /doc/_highlight/styles/idea.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Intellij Idea-like styling (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | color: #000; 10 | background: #fff; 11 | } 12 | 13 | pre .subst, 14 | pre .title { 15 | font-weight: normal; 16 | color: #000; 17 | } 18 | 19 | pre .comment, 20 | pre .template_comment, 21 | pre .javadoc, 22 | pre .diff .header { 23 | color: #808080; 24 | font-style: italic; 25 | } 26 | 27 | pre .annotation, 28 | pre .decorator, 29 | pre .preprocessor, 30 | pre .pragma, 31 | pre .doctype, 32 | pre .pi, 33 | pre .chunk, 34 | pre .shebang, 35 | pre .apache .cbracket, 36 | pre .prompt, 37 | pre .http .title { 38 | color: #808000; 39 | } 40 | 41 | pre .tag, 42 | pre .pi { 43 | background: #efefef; 44 | } 45 | 46 | pre .tag .title, 47 | pre .id, 48 | pre .attr_selector, 49 | pre .pseudo, 50 | pre .literal, 51 | pre .keyword, 52 | pre .hexcolor, 53 | pre .css .function, 54 | pre .ini .title, 55 | pre .css .class, 56 | pre .list .title, 57 | pre .clojure .title, 58 | pre .nginx .title, 59 | pre .tex .command, 60 | pre .request, 61 | pre .status { 62 | font-weight: bold; 63 | color: #000080; 64 | } 65 | 66 | pre .attribute, 67 | pre .rules .keyword, 68 | pre .number, 69 | pre .date, 70 | pre .regexp, 71 | pre .tex .special { 72 | font-weight: bold; 73 | color: #0000ff; 74 | } 75 | 76 | pre .number, 77 | pre .regexp { 78 | font-weight: normal; 79 | } 80 | 81 | pre .string, 82 | pre .value, 83 | pre .filter .argument, 84 | pre .css .function .params, 85 | pre .apache .tag { 86 | color: #008000; 87 | font-weight: bold; 88 | } 89 | 90 | pre .symbol, 91 | pre .ruby .symbol .string, 92 | pre .char, 93 | pre .tex .formula { 94 | color: #000; 95 | background: #d0eded; 96 | font-style: italic; 97 | } 98 | 99 | pre .phpdoc, 100 | pre .yardoctag, 101 | pre .javadoctag { 102 | text-decoration: underline; 103 | } 104 | 105 | pre .variable, 106 | pre .envvar, 107 | pre .apache .sqbracket, 108 | pre .nginx .built_in { 109 | color: #660e7a; 110 | } 111 | 112 | pre .addition { 113 | background: #baeeba; 114 | } 115 | 116 | pre .deletion { 117 | background: #ffc8bd; 118 | } 119 | 120 | pre .diff .change { 121 | background: #bccff9; 122 | } 123 | -------------------------------------------------------------------------------- /doc/_highlight/styles/ir_black.css: -------------------------------------------------------------------------------- 1 | /* 2 | IR_Black style (c) Vasily Mikhailitchenko 3 | */ 4 | 5 | pre code { 6 | display: block; padding: 0.5em; 7 | background: #000; color: #f8f8f8; 8 | } 9 | 10 | pre .shebang, 11 | pre .comment, 12 | pre .template_comment, 13 | pre .javadoc { 14 | color: #7c7c7c; 15 | } 16 | 17 | pre .keyword, 18 | pre .tag, 19 | pre .tex .command, 20 | pre .request, 21 | pre .status, 22 | pre .clojure .attribute { 23 | color: #96CBFE; 24 | } 25 | 26 | pre .sub .keyword, 27 | pre .method, 28 | pre .list .title, 29 | pre .nginx .title { 30 | color: #FFFFB6; 31 | } 32 | 33 | pre .string, 34 | pre .tag .value, 35 | pre .cdata, 36 | pre .filter .argument, 37 | pre .attr_selector, 38 | pre .apache .cbracket, 39 | pre .date, 40 | pre .coffeescript .attribute { 41 | color: #A8FF60; 42 | } 43 | 44 | pre .subst { 45 | color: #DAEFA3; 46 | } 47 | 48 | pre .regexp { 49 | color: #E9C062; 50 | } 51 | 52 | pre .title, 53 | pre .sub .identifier, 54 | pre .pi, 55 | pre .decorator, 56 | pre .tex .special, 57 | pre .haskell .type, 58 | pre .constant, 59 | pre .smalltalk .class, 60 | pre .javadoctag, 61 | pre .yardoctag, 62 | pre .phpdoc, 63 | pre .nginx .built_in { 64 | color: #FFFFB6; 65 | } 66 | 67 | pre .symbol, 68 | pre .ruby .symbol .string, 69 | pre .number, 70 | pre .variable, 71 | pre .vbscript, 72 | pre .literal { 73 | color: #C6C5FE; 74 | } 75 | 76 | pre .css .tag { 77 | color: #96CBFE; 78 | } 79 | 80 | pre .css .rules .property, 81 | pre .css .id { 82 | color: #FFFFB6; 83 | } 84 | 85 | pre .css .class { 86 | color: #FFF; 87 | } 88 | 89 | pre .hexcolor { 90 | color: #C6C5FE; 91 | } 92 | 93 | pre .number { 94 | color:#FF73FD; 95 | } 96 | 97 | pre .coffeescript .javascript, 98 | pre .javascript .xml, 99 | pre .tex .formula, 100 | pre .xml .javascript, 101 | pre .xml .vbscript, 102 | pre .xml .css, 103 | pre .xml .cdata { 104 | opacity: 0.7; 105 | } 106 | -------------------------------------------------------------------------------- /doc/_highlight/styles/magula.css: -------------------------------------------------------------------------------- 1 | /* 2 | Description: Magula style for highligh.js 3 | Author: Ruslan Keba 4 | Website: http://rukeba.com/ 5 | Version: 1.0 6 | Date: 2009-01-03 7 | Music: Aphex Twin / Xtal 8 | */ 9 | 10 | pre code { 11 | display: block; padding: 0.5em; 12 | background-color: #f4f4f4; 13 | } 14 | 15 | pre code, 16 | pre .subst, 17 | pre .lisp .title, 18 | pre .clojure .built_in { 19 | color: black; 20 | } 21 | 22 | pre .string, 23 | pre .title, 24 | pre .parent, 25 | pre .tag .value, 26 | pre .rules .value, 27 | pre .rules .value .number, 28 | pre .preprocessor, 29 | pre .pragma, 30 | pre .ruby .symbol, 31 | pre .ruby .symbol .string, 32 | pre .aggregate, 33 | pre .template_tag, 34 | pre .django .variable, 35 | pre .smalltalk .class, 36 | pre .addition, 37 | pre .flow, 38 | pre .stream, 39 | pre .bash .variable, 40 | pre .apache .cbracket, 41 | pre .coffeescript .attribute { 42 | color: #050; 43 | } 44 | 45 | pre .comment, 46 | pre .annotation, 47 | pre .template_comment, 48 | pre .diff .header, 49 | pre .chunk { 50 | color: #777; 51 | } 52 | 53 | pre .number, 54 | pre .date, 55 | pre .regexp, 56 | pre .literal, 57 | pre .smalltalk .symbol, 58 | pre .smalltalk .char, 59 | pre .change, 60 | pre .tex .special { 61 | color: #800; 62 | } 63 | 64 | pre .label, 65 | pre .javadoc, 66 | pre .ruby .string, 67 | pre .decorator, 68 | pre .filter .argument, 69 | pre .localvars, 70 | pre .array, 71 | pre .attr_selector, 72 | pre .pseudo, 73 | pre .pi, 74 | pre .doctype, 75 | pre .deletion, 76 | pre .envvar, 77 | pre .shebang, 78 | pre .apache .sqbracket, 79 | pre .nginx .built_in, 80 | pre .tex .formula, 81 | pre .prompt, 82 | pre .clojure .attribute { 83 | color: #00e; 84 | } 85 | 86 | pre .keyword, 87 | pre .id, 88 | pre .phpdoc, 89 | pre .title, 90 | pre .built_in, 91 | pre .aggregate, 92 | pre .smalltalk .class, 93 | pre .winutils, 94 | pre .bash .variable, 95 | pre .apache .tag, 96 | pre .xml .tag, 97 | pre .tex .command, 98 | pre .request, 99 | pre .status { 100 | font-weight: bold; 101 | color: navy; 102 | } 103 | 104 | pre .nginx .built_in { 105 | font-weight: normal; 106 | } 107 | 108 | pre .coffeescript .javascript, 109 | pre .javascript .xml, 110 | pre .tex .formula, 111 | pre .xml .javascript, 112 | pre .xml .vbscript, 113 | pre .xml .css, 114 | pre .xml .cdata { 115 | opacity: 0.5; 116 | } 117 | 118 | /* --- */ 119 | pre .apache .tag { 120 | font-weight: bold; 121 | color: blue; 122 | } 123 | 124 | -------------------------------------------------------------------------------- /doc/_highlight/styles/mono-blue.css: -------------------------------------------------------------------------------- 1 | /* 2 | Five-color theme from a single blue hue. 3 | */ 4 | pre code { 5 | display: block; padding: 0.5em; 6 | background: #EAEEF3; color: #00193A; 7 | } 8 | 9 | pre .keyword, 10 | pre .title, 11 | pre .important, 12 | pre .request, 13 | pre .header, 14 | pre .javadoctag { 15 | font-weight: bold; 16 | } 17 | 18 | pre .comment, 19 | pre .chunk, 20 | pre .template_comment { 21 | color: #738191; 22 | } 23 | 24 | pre .string, 25 | pre .title, 26 | pre .parent, 27 | pre .built_in, 28 | pre .literal, 29 | pre .filename, 30 | pre .value, 31 | pre .addition, 32 | pre .tag, 33 | pre .argument, 34 | pre .link_label, 35 | pre .blockquote, 36 | pre .header { 37 | color: #0048AB; 38 | } 39 | 40 | pre .decorator, 41 | pre .prompt, 42 | pre .yardoctag, 43 | pre .subst, 44 | pre .symbol, 45 | pre .doctype, 46 | pre .regexp, 47 | pre .preprocessor, 48 | pre .pragma, 49 | pre .pi, 50 | pre .attribute, 51 | pre .attr_selector, 52 | pre .javadoc, 53 | pre .xmlDocTag, 54 | pre .deletion, 55 | pre .shebang, 56 | pre .string .variable, 57 | pre .link_url, 58 | pre .bullet, 59 | pre .sqbracket, 60 | pre .phony { 61 | color: #4C81C9; 62 | } 63 | -------------------------------------------------------------------------------- /doc/_highlight/styles/monokai.css: -------------------------------------------------------------------------------- 1 | /* 2 | Monokai style - ported by Luigi Maselli - http://grigio.org 3 | */ 4 | 5 | pre code { 6 | display: block; padding: 0.5em; 7 | background: #272822; 8 | } 9 | 10 | pre .tag, 11 | pre .tag .title, 12 | pre .keyword, 13 | pre .literal, 14 | pre .strong, 15 | pre .change, 16 | pre .winutils, 17 | pre .flow, 18 | pre .lisp .title, 19 | pre .clojure .built_in, 20 | pre .nginx .title, 21 | pre .tex .special { 22 | color: #F92672; 23 | } 24 | 25 | pre code { 26 | color: #DDD; 27 | } 28 | 29 | pre code .constant, 30 | pre .asciidoc .code { 31 | color: #66D9EF; 32 | } 33 | 34 | pre .code, 35 | pre .class .title, 36 | pre .header { 37 | color: white; 38 | } 39 | 40 | pre .link_label, 41 | pre .attribute, 42 | pre .symbol, 43 | pre .symbol .string, 44 | pre .value, 45 | pre .regexp { 46 | color: #BF79DB; 47 | } 48 | 49 | pre .link_url, 50 | pre .tag .value, 51 | pre .string, 52 | pre .bullet, 53 | pre .subst, 54 | pre .title, 55 | pre .emphasis, 56 | pre .haskell .type, 57 | pre .preprocessor, 58 | pre .pragma, 59 | pre .ruby .class .parent, 60 | pre .built_in, 61 | pre .sql .aggregate, 62 | pre .django .template_tag, 63 | pre .django .variable, 64 | pre .smalltalk .class, 65 | pre .javadoc, 66 | pre .django .filter .argument, 67 | pre .smalltalk .localvars, 68 | pre .smalltalk .array, 69 | pre .attr_selector, 70 | pre .pseudo, 71 | pre .addition, 72 | pre .stream, 73 | pre .envvar, 74 | pre .apache .tag, 75 | pre .apache .cbracket, 76 | pre .tex .command, 77 | pre .prompt { 78 | color: #A6E22E; 79 | } 80 | 81 | pre .comment, 82 | pre .java .annotation, 83 | pre .smartquote, 84 | pre .blockquote, 85 | pre .horizontal_rule, 86 | pre .python .decorator, 87 | pre .template_comment, 88 | pre .pi, 89 | pre .doctype, 90 | pre .deletion, 91 | pre .shebang, 92 | pre .apache .sqbracket, 93 | pre .tex .formula { 94 | color: #75715E; 95 | } 96 | 97 | pre .keyword, 98 | pre .literal, 99 | pre .css .id, 100 | pre .phpdoc, 101 | pre .title, 102 | pre .header, 103 | pre .haskell .type, 104 | pre .vbscript .built_in, 105 | pre .sql .aggregate, 106 | pre .rsl .built_in, 107 | pre .smalltalk .class, 108 | pre .diff .header, 109 | pre .chunk, 110 | pre .winutils, 111 | pre .bash .variable, 112 | pre .apache .tag, 113 | pre .tex .special, 114 | pre .request, 115 | pre .status { 116 | font-weight: bold; 117 | } 118 | 119 | pre .coffeescript .javascript, 120 | pre .javascript .xml, 121 | pre .tex .formula, 122 | pre .xml .javascript, 123 | pre .xml .vbscript, 124 | pre .xml .css, 125 | pre .xml .cdata { 126 | opacity: 0.5; 127 | } 128 | -------------------------------------------------------------------------------- /doc/_highlight/styles/monokai_sublime.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/ 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; 9 | padding: 0.5em; 10 | background: #23241f; 11 | } 12 | pre .tag, 13 | pre code { 14 | color: #f8f8f2; 15 | } 16 | pre .keyword, 17 | pre .function, 18 | pre .literal, 19 | pre .change, 20 | pre .winutils, 21 | pre .flow, 22 | pre .lisp .title, 23 | pre .clojure .built_in, 24 | pre .nginx .title, 25 | pre .tex .special { 26 | color: #66d9ef; 27 | } 28 | pre .variable, 29 | pre .params { 30 | color: #fd9720; 31 | } 32 | pre .constant { 33 | color: #66d9ef; 34 | } 35 | pre .title, 36 | pre .class .title, 37 | pre .css .class { 38 | color: #a6e22e; 39 | } 40 | pre .attribute, 41 | pre .symbol, 42 | pre .symbol .string, 43 | pre .tag .title, 44 | pre .value, 45 | pre .css .tag { 46 | color: #f92672; 47 | } 48 | pre .number, 49 | pre .preprocessor, 50 | pre .pragma, 51 | pre .regexp { 52 | color: #ae81ff; 53 | } 54 | pre .tag .value, 55 | pre .string, 56 | pre .css .id, 57 | pre .subst, 58 | pre .haskell .type, 59 | pre .ruby .class .parent, 60 | pre .built_in, 61 | pre .sql .aggregate, 62 | pre .django .template_tag, 63 | pre .django .variable, 64 | pre .smalltalk .class, 65 | pre .django .filter .argument, 66 | pre .smalltalk .localvars, 67 | pre .smalltalk .array, 68 | pre .attr_selector, 69 | pre .pseudo, 70 | pre .addition, 71 | pre .stream, 72 | pre .envvar, 73 | pre .apache .tag, 74 | pre .apache .cbracket, 75 | pre .tex .command, 76 | pre .prompt { 77 | color: #e6db74; 78 | } 79 | pre .comment, 80 | pre .javadoc, 81 | pre .java .annotation, 82 | pre .python .decorator, 83 | pre .template_comment, 84 | pre .pi, 85 | pre .doctype, 86 | pre .deletion, 87 | pre .shebang, 88 | pre .apache .sqbracket, 89 | pre .tex .formula { 90 | color: #75715e; 91 | } 92 | pre .coffeescript .javascript, 93 | pre .javascript .xml, 94 | pre .tex .formula { 95 | opacity: 0.5; 96 | } 97 | pre .xml .javascript, 98 | pre .xml .vbscript, 99 | pre .xml .css, 100 | pre .xml .cdata { 101 | opacity: 0.5; 102 | } 103 | -------------------------------------------------------------------------------- /doc/_highlight/styles/obsidian.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Obsidian style 3 | * ported by Alexander Marenin (http://github.com/ioncreature) 4 | */ 5 | 6 | pre code { 7 | display: block; padding: 0.5em; 8 | background: #282B2E; 9 | } 10 | 11 | pre .keyword, 12 | pre .literal, 13 | pre .change, 14 | pre .winutils, 15 | pre .flow, 16 | pre .lisp .title, 17 | pre .clojure .built_in, 18 | pre .nginx .title, 19 | pre .css .id, 20 | pre .tex .special { 21 | color: #93C763; 22 | } 23 | 24 | pre .number { 25 | color: #FFCD22; 26 | } 27 | 28 | pre code { 29 | color: #E0E2E4; 30 | } 31 | 32 | pre .css .tag, 33 | pre .css .pseudo { 34 | color: #D0D2B5; 35 | } 36 | 37 | pre .attribute, 38 | pre code .constant { 39 | color: #668BB0; 40 | } 41 | 42 | pre .xml .attribute { 43 | color: #B3B689; 44 | } 45 | 46 | pre .xml .tag .value { 47 | color: #E8E2B7; 48 | } 49 | 50 | pre .code, 51 | pre .class .title, 52 | pre .header { 53 | color: white; 54 | } 55 | 56 | pre .class, 57 | pre .hexcolor { 58 | color: #93C763; 59 | } 60 | 61 | pre .regexp { 62 | color: #D39745; 63 | } 64 | 65 | pre .at_rule, 66 | pre .at_rule .keyword { 67 | color: #A082BD; 68 | } 69 | 70 | pre .doctype { 71 | color: #557182; 72 | } 73 | 74 | pre .link_url, 75 | pre .tag, 76 | pre .tag .title, 77 | pre .bullet, 78 | pre .subst, 79 | pre .emphasis, 80 | pre .haskell .type, 81 | pre .preprocessor, 82 | pre .pragma, 83 | pre .ruby .class .parent, 84 | pre .built_in, 85 | pre .sql .aggregate, 86 | pre .django .template_tag, 87 | pre .django .variable, 88 | pre .smalltalk .class, 89 | pre .javadoc, 90 | pre .django .filter .argument, 91 | pre .smalltalk .localvars, 92 | pre .smalltalk .array, 93 | pre .attr_selector, 94 | pre .pseudo, 95 | pre .addition, 96 | pre .stream, 97 | pre .envvar, 98 | pre .apache .tag, 99 | pre .apache .cbracket, 100 | pre .tex .command, 101 | pre .prompt { 102 | color: #8CBBAD; 103 | } 104 | 105 | pre .string { 106 | color: #EC7600; 107 | } 108 | 109 | pre .comment, 110 | pre .java .annotation, 111 | pre .blockquote, 112 | pre .horizontal_rule, 113 | pre .python .decorator, 114 | pre .template_comment, 115 | pre .pi, 116 | pre .deletion, 117 | pre .shebang, 118 | pre .apache .sqbracket, 119 | pre .tex .formula { 120 | color: #818E96; 121 | } 122 | 123 | pre .keyword, 124 | pre .literal, 125 | pre .css .id, 126 | pre .phpdoc, 127 | pre .title, 128 | pre .header, 129 | pre .haskell .type, 130 | pre .vbscript .built_in, 131 | pre .sql .aggregate, 132 | pre .rsl .built_in, 133 | pre .smalltalk .class, 134 | pre .diff .header, 135 | pre .chunk, 136 | pre .winutils, 137 | pre .bash .variable, 138 | pre .apache .tag, 139 | pre .tex .special, 140 | pre .request, 141 | pre .at_rule .keyword, 142 | pre .status { 143 | font-weight: bold; 144 | } 145 | 146 | pre .coffeescript .javascript, 147 | pre .javascript .xml, 148 | pre .tex .formula, 149 | pre .xml .javascript, 150 | pre .xml .vbscript, 151 | pre .xml .css, 152 | pre .xml .cdata { 153 | opacity: 0.5; 154 | } 155 | -------------------------------------------------------------------------------- /doc/_highlight/styles/pojoaque.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pojoaque Style by Jason Tate 4 | http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html 5 | Based on Solarized Style from http://ethanschoonover.com/solarized 6 | 7 | */ 8 | 9 | pre code { 10 | display: block; padding: 0.5em; 11 | color: #DCCF8F; 12 | background: url(./pojoaque.jpg) repeat scroll left top #181914; 13 | } 14 | 15 | pre .comment, 16 | pre .template_comment, 17 | pre .diff .header, 18 | pre .doctype, 19 | pre .lisp .string, 20 | pre .javadoc { 21 | color: #586e75; 22 | font-style: italic; 23 | } 24 | 25 | pre .keyword, 26 | pre .css .rule .keyword, 27 | pre .winutils, 28 | pre .javascript .title, 29 | pre .method, 30 | pre .addition, 31 | pre .css .tag, 32 | pre .clojure .title, 33 | pre .nginx .title { 34 | color: #B64926; 35 | } 36 | 37 | pre .number, 38 | pre .command, 39 | pre .string, 40 | pre .tag .value, 41 | pre .phpdoc, 42 | pre .tex .formula, 43 | pre .regexp, 44 | pre .hexcolor { 45 | color: #468966; 46 | } 47 | 48 | pre .title, 49 | pre .localvars, 50 | pre .function .title, 51 | pre .chunk, 52 | pre .decorator, 53 | pre .built_in, 54 | pre .lisp .title, 55 | pre .clojure .built_in, 56 | pre .identifier, 57 | pre .id { 58 | color: #FFB03B; 59 | } 60 | 61 | pre .attribute, 62 | pre .variable, 63 | pre .lisp .body, 64 | pre .smalltalk .number, 65 | pre .constant, 66 | pre .class .title, 67 | pre .parent, 68 | pre .haskell .type { 69 | color: #b58900; 70 | } 71 | 72 | pre .css .attribute { 73 | color: #b89859; 74 | } 75 | 76 | pre .css .number,pre .css .hexcolor{ 77 | color: #DCCF8F; 78 | } 79 | 80 | pre .css .class { 81 | color: #d3a60c; 82 | } 83 | 84 | pre .preprocessor, 85 | pre .pragma, 86 | pre .pi, 87 | pre .shebang, 88 | pre .symbol, 89 | pre .symbol .string, 90 | pre .diff .change, 91 | pre .special, 92 | pre .attr_selector, 93 | pre .important, 94 | pre .subst, 95 | pre .cdata { 96 | color: #cb4b16; 97 | } 98 | 99 | pre .deletion { 100 | color: #dc322f; 101 | } 102 | 103 | pre .tex .formula { 104 | background: #073642; 105 | } 106 | -------------------------------------------------------------------------------- /doc/_highlight/styles/pojoaque.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soumith/torch-signal/14479a9c1bf70f90a5267ed5aa30a34e1a9effd3/doc/_highlight/styles/pojoaque.jpg -------------------------------------------------------------------------------- /doc/_highlight/styles/railscasts.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Railscasts-like style (c) Visoft, Inc. (Damien White) 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; 9 | padding: 0.5em; 10 | background: #232323; 11 | color: #E6E1DC; 12 | } 13 | 14 | pre .comment, 15 | pre .template_comment, 16 | pre .javadoc, 17 | pre .shebang { 18 | color: #BC9458; 19 | font-style: italic; 20 | } 21 | 22 | pre .keyword, 23 | pre .ruby .function .keyword, 24 | pre .request, 25 | pre .status, 26 | pre .nginx .title, 27 | pre .method, 28 | pre .list .title { 29 | color: #C26230; 30 | } 31 | 32 | pre .string, 33 | pre .number, 34 | pre .regexp, 35 | pre .tag .value, 36 | pre .cdata, 37 | pre .filter .argument, 38 | pre .attr_selector, 39 | pre .apache .cbracket, 40 | pre .date, 41 | pre .tex .command, 42 | pre .markdown .link_label { 43 | color: #A5C261; 44 | } 45 | 46 | pre .subst { 47 | color: #519F50; 48 | } 49 | 50 | pre .tag, 51 | pre .tag .keyword, 52 | pre .tag .title, 53 | pre .doctype, 54 | pre .sub .identifier, 55 | pre .pi, 56 | pre .input_number { 57 | color: #E8BF6A; 58 | } 59 | 60 | pre .identifier { 61 | color: #D0D0FF; 62 | } 63 | 64 | pre .class .title, 65 | pre .haskell .type, 66 | pre .smalltalk .class, 67 | pre .javadoctag, 68 | pre .yardoctag, 69 | pre .phpdoc { 70 | text-decoration: none; 71 | } 72 | 73 | pre .constant { 74 | color: #DA4939; 75 | } 76 | 77 | 78 | pre .symbol, 79 | pre .built_in, 80 | pre .ruby .symbol .string, 81 | pre .ruby .symbol .identifier, 82 | pre .markdown .link_url, 83 | pre .attribute { 84 | color: #6D9CBE; 85 | } 86 | 87 | pre .markdown .link_url { 88 | text-decoration: underline; 89 | } 90 | 91 | 92 | 93 | pre .params, 94 | pre .variable, 95 | pre .clojure .attribute { 96 | color: #D0D0FF; 97 | } 98 | 99 | pre .css .tag, 100 | pre .rules .property, 101 | pre .pseudo, 102 | pre .tex .special { 103 | color: #CDA869; 104 | } 105 | 106 | pre .css .class { 107 | color: #9B703F; 108 | } 109 | 110 | pre .rules .keyword { 111 | color: #C5AF75; 112 | } 113 | 114 | pre .rules .value { 115 | color: #CF6A4C; 116 | } 117 | 118 | pre .css .id { 119 | color: #8B98AB; 120 | } 121 | 122 | pre .annotation, 123 | pre .apache .sqbracket, 124 | pre .nginx .built_in { 125 | color: #9B859D; 126 | } 127 | 128 | pre .preprocessor, 129 | pre .preprocessor * 130 | pre .pragma { 131 | color: #8996A8 !important; 132 | } 133 | 134 | pre .hexcolor, 135 | pre .css .value .number { 136 | color: #A5C261; 137 | } 138 | 139 | pre .title, 140 | pre .decorator, 141 | pre .css .function { 142 | color: #FFC66D; 143 | } 144 | 145 | pre .diff .header, 146 | pre .chunk { 147 | background-color: #2F33AB; 148 | color: #E6E1DC; 149 | display: inline-block; 150 | width: 100%; 151 | } 152 | 153 | pre .diff .change { 154 | background-color: #4A410D; 155 | color: #F8F8F8; 156 | display: inline-block; 157 | width: 100%; 158 | } 159 | 160 | pre .addition { 161 | background-color: #144212; 162 | color: #E6E1DC; 163 | display: inline-block; 164 | width: 100%; 165 | } 166 | 167 | pre .deletion { 168 | background-color: #600; 169 | color: #E6E1DC; 170 | display: inline-block; 171 | width: 100%; 172 | } 173 | 174 | pre .coffeescript .javascript, 175 | pre .javascript .xml, 176 | pre .tex .formula, 177 | pre .xml .javascript, 178 | pre .xml .vbscript, 179 | pre .xml .css, 180 | pre .xml .cdata { 181 | opacity: 0.7; 182 | } 183 | -------------------------------------------------------------------------------- /doc/_highlight/styles/rainbow.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Style with support for rainbow parens 4 | 5 | */ 6 | 7 | pre ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; } 8 | pre ::selection { background:#FF5E99; color:#fff; text-shadow: none; } 9 | 10 | pre code { 11 | display: block; padding: 0.5em; 12 | background: #474949; color: #D1D9E1; 13 | } 14 | 15 | 16 | pre .body, 17 | pre .collection { 18 | color: #D1D9E1; 19 | } 20 | 21 | pre .comment, 22 | pre .template_comment, 23 | pre .diff .header, 24 | pre .doctype, 25 | pre .lisp .string, 26 | pre .javadoc { 27 | color: #969896; 28 | font-style: italic; 29 | } 30 | 31 | pre .keyword, 32 | pre .clojure .attribute, 33 | pre .winutils, 34 | pre .javascript .title, 35 | pre .addition, 36 | pre .css .tag { 37 | color: #cc99cc; 38 | } 39 | 40 | pre .number { color: #f99157; } 41 | 42 | pre .command, 43 | pre .string, 44 | pre .tag .value, 45 | pre .phpdoc, 46 | pre .tex .formula, 47 | pre .regexp, 48 | pre .hexcolor { 49 | color: #8abeb7; 50 | } 51 | 52 | pre .title, 53 | pre .localvars, 54 | pre .function .title, 55 | pre .chunk, 56 | pre .decorator, 57 | pre .built_in, 58 | pre .lisp .title, 59 | pre .identifier 60 | { 61 | color: #b5bd68; 62 | } 63 | 64 | pre .class .keyword 65 | { 66 | color: #f2777a; 67 | } 68 | 69 | pre .variable, 70 | pre .lisp .body, 71 | pre .smalltalk .number, 72 | pre .constant, 73 | pre .class .title, 74 | pre .parent, 75 | pre .haskell .label, 76 | pre .id, 77 | pre .lisp .title, 78 | pre .clojure .title .built_in { 79 | color: #ffcc66; 80 | } 81 | 82 | pre .tag .title, 83 | pre .rules .property, 84 | pre .django .tag .keyword, 85 | pre .clojure .title .built_in { 86 | font-weight: bold; 87 | } 88 | 89 | pre .attribute, 90 | pre .clojure .title { 91 | color: #81a2be; 92 | } 93 | 94 | pre .preprocessor, 95 | pre .pragma, 96 | pre .pi, 97 | pre .shebang, 98 | pre .symbol, 99 | pre .symbol .string, 100 | pre .diff .change, 101 | pre .special, 102 | pre .attr_selector, 103 | pre .important, 104 | pre .subst, 105 | pre .cdata { 106 | color: #f99157; 107 | } 108 | 109 | pre .deletion { 110 | color: #dc322f; 111 | } 112 | 113 | pre .tex .formula { 114 | background: #eee8d5; 115 | } 116 | -------------------------------------------------------------------------------- /doc/_highlight/styles/school_book.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | School Book style from goldblog.com.ua (c) Zaripov Yura 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 15px 0.5em 0.5em 30px; 9 | font-size: 11px !important; 10 | line-height:16px !important; 11 | } 12 | 13 | pre{ 14 | background:#f6f6ae url(./school_book.png); 15 | border-top: solid 2px #d2e8b9; 16 | border-bottom: solid 1px #d2e8b9; 17 | } 18 | 19 | pre .keyword, 20 | pre .literal, 21 | pre .change, 22 | pre .winutils, 23 | pre .flow, 24 | pre .lisp .title, 25 | pre .clojure .built_in, 26 | pre .nginx .title, 27 | pre .tex .special { 28 | color:#005599; 29 | font-weight:bold; 30 | } 31 | 32 | pre code, 33 | pre .subst, 34 | pre .tag .keyword { 35 | color: #3E5915; 36 | } 37 | 38 | pre .string, 39 | pre .title, 40 | pre .haskell .type, 41 | pre .tag .value, 42 | pre .css .rules .value, 43 | pre .preprocessor, 44 | pre .pragma, 45 | pre .ruby .symbol, 46 | pre .ruby .symbol .string, 47 | pre .ruby .class .parent, 48 | pre .built_in, 49 | pre .sql .aggregate, 50 | pre .django .template_tag, 51 | pre .django .variable, 52 | pre .smalltalk .class, 53 | pre .javadoc, 54 | pre .ruby .string, 55 | pre .django .filter .argument, 56 | pre .smalltalk .localvars, 57 | pre .smalltalk .array, 58 | pre .attr_selector, 59 | pre .pseudo, 60 | pre .addition, 61 | pre .stream, 62 | pre .envvar, 63 | pre .apache .tag, 64 | pre .apache .cbracket, 65 | pre .nginx .built_in, 66 | pre .tex .command, 67 | pre .coffeescript .attribute { 68 | color: #2C009F; 69 | } 70 | 71 | pre .comment, 72 | pre .java .annotation, 73 | pre .python .decorator, 74 | pre .template_comment, 75 | pre .pi, 76 | pre .doctype, 77 | pre .deletion, 78 | pre .shebang, 79 | pre .apache .sqbracket { 80 | color: #E60415; 81 | } 82 | 83 | pre .keyword, 84 | pre .literal, 85 | pre .css .id, 86 | pre .phpdoc, 87 | pre .title, 88 | pre .haskell .type, 89 | pre .vbscript .built_in, 90 | pre .sql .aggregate, 91 | pre .rsl .built_in, 92 | pre .smalltalk .class, 93 | pre .xml .tag .title, 94 | pre .diff .header, 95 | pre .chunk, 96 | pre .winutils, 97 | pre .bash .variable, 98 | pre .apache .tag, 99 | pre .tex .command, 100 | pre .request, 101 | pre .status { 102 | font-weight: bold; 103 | } 104 | 105 | pre .coffeescript .javascript, 106 | pre .javascript .xml, 107 | pre .tex .formula, 108 | pre .xml .javascript, 109 | pre .xml .vbscript, 110 | pre .xml .css, 111 | pre .xml .cdata { 112 | opacity: 0.5; 113 | } 114 | -------------------------------------------------------------------------------- /doc/_highlight/styles/school_book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soumith/torch-signal/14479a9c1bf70f90a5267ed5aa30a34e1a9effd3/doc/_highlight/styles/school_book.png -------------------------------------------------------------------------------- /doc/_highlight/styles/solarized_dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #002b36; color: #839496; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .diff .header, 15 | pre .doctype, 16 | pre .pi, 17 | pre .lisp .string, 18 | pre .javadoc { 19 | color: #586e75; 20 | font-style: italic; 21 | } 22 | 23 | pre .keyword, 24 | pre .winutils, 25 | pre .method, 26 | pre .addition, 27 | pre .css .tag, 28 | pre .request, 29 | pre .status, 30 | pre .nginx .title { 31 | color: #859900; 32 | } 33 | 34 | pre .number, 35 | pre .command, 36 | pre .string, 37 | pre .tag .value, 38 | pre .rules .value, 39 | pre .phpdoc, 40 | pre .tex .formula, 41 | pre .regexp, 42 | pre .hexcolor { 43 | color: #2aa198; 44 | } 45 | 46 | pre .title, 47 | pre .localvars, 48 | pre .chunk, 49 | pre .decorator, 50 | pre .built_in, 51 | pre .identifier, 52 | pre .vhdl .literal, 53 | pre .id, 54 | pre .css .function { 55 | color: #268bd2; 56 | } 57 | 58 | pre .attribute, 59 | pre .variable, 60 | pre .lisp .body, 61 | pre .smalltalk .number, 62 | pre .constant, 63 | pre .class .title, 64 | pre .parent, 65 | pre .haskell .type { 66 | color: #b58900; 67 | } 68 | 69 | pre .preprocessor, 70 | pre .preprocessor .keyword, 71 | pre .pragma, 72 | pre .shebang, 73 | pre .symbol, 74 | pre .symbol .string, 75 | pre .diff .change, 76 | pre .special, 77 | pre .attr_selector, 78 | pre .important, 79 | pre .subst, 80 | pre .cdata, 81 | pre .clojure .title, 82 | pre .css .pseudo { 83 | color: #cb4b16; 84 | } 85 | 86 | pre .deletion { 87 | color: #dc322f; 88 | } 89 | 90 | pre .tex .formula { 91 | background: #073642; 92 | } 93 | -------------------------------------------------------------------------------- /doc/_highlight/styles/solarized_light.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #fdf6e3; color: #657b83; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .diff .header, 15 | pre .doctype, 16 | pre .pi, 17 | pre .lisp .string, 18 | pre .javadoc { 19 | color: #93a1a1; 20 | font-style: italic; 21 | } 22 | 23 | pre .keyword, 24 | pre .winutils, 25 | pre .method, 26 | pre .addition, 27 | pre .css .tag, 28 | pre .request, 29 | pre .status, 30 | pre .nginx .title { 31 | color: #859900; 32 | } 33 | 34 | pre .number, 35 | pre .command, 36 | pre .string, 37 | pre .tag .value, 38 | pre .rules .value, 39 | pre .phpdoc, 40 | pre .tex .formula, 41 | pre .regexp, 42 | pre .hexcolor { 43 | color: #2aa198; 44 | } 45 | 46 | pre .title, 47 | pre .localvars, 48 | pre .chunk, 49 | pre .decorator, 50 | pre .built_in, 51 | pre .identifier, 52 | pre .vhdl .literal, 53 | pre .id, 54 | pre .css .function { 55 | color: #268bd2; 56 | } 57 | 58 | pre .attribute, 59 | pre .variable, 60 | pre .lisp .body, 61 | pre .smalltalk .number, 62 | pre .constant, 63 | pre .class .title, 64 | pre .parent, 65 | pre .haskell .type { 66 | color: #b58900; 67 | } 68 | 69 | pre .preprocessor, 70 | pre .preprocessor .keyword, 71 | pre .pragma, 72 | pre .shebang, 73 | pre .symbol, 74 | pre .symbol .string, 75 | pre .diff .change, 76 | pre .special, 77 | pre .attr_selector, 78 | pre .important, 79 | pre .subst, 80 | pre .cdata, 81 | pre .clojure .title, 82 | pre .css .pseudo { 83 | color: #cb4b16; 84 | } 85 | 86 | pre .deletion { 87 | color: #dc322f; 88 | } 89 | 90 | pre .tex .formula { 91 | background: #eee8d5; 92 | } 93 | -------------------------------------------------------------------------------- /doc/_highlight/styles/sunburst.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Sunburst-like style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #000; color: #f8f8f8; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .javadoc { 15 | color: #aeaeae; 16 | font-style: italic; 17 | } 18 | 19 | pre .keyword, 20 | pre .ruby .function .keyword, 21 | pre .request, 22 | pre .status, 23 | pre .nginx .title { 24 | color: #E28964; 25 | } 26 | 27 | pre .function .keyword, 28 | pre .sub .keyword, 29 | pre .method, 30 | pre .list .title { 31 | color: #99CF50; 32 | } 33 | 34 | pre .string, 35 | pre .tag .value, 36 | pre .cdata, 37 | pre .filter .argument, 38 | pre .attr_selector, 39 | pre .apache .cbracket, 40 | pre .date, 41 | pre .tex .command, 42 | pre .coffeescript .attribute { 43 | color: #65B042; 44 | } 45 | 46 | pre .subst { 47 | color: #DAEFA3; 48 | } 49 | 50 | pre .regexp { 51 | color: #E9C062; 52 | } 53 | 54 | pre .title, 55 | pre .sub .identifier, 56 | pre .pi, 57 | pre .tag, 58 | pre .tag .keyword, 59 | pre .decorator, 60 | pre .shebang, 61 | pre .prompt { 62 | color: #89BDFF; 63 | } 64 | 65 | pre .class .title, 66 | pre .haskell .type, 67 | pre .smalltalk .class, 68 | pre .javadoctag, 69 | pre .yardoctag, 70 | pre .phpdoc { 71 | text-decoration: underline; 72 | } 73 | 74 | pre .symbol, 75 | pre .ruby .symbol .string, 76 | pre .number { 77 | color: #3387CC; 78 | } 79 | 80 | pre .params, 81 | pre .variable, 82 | pre .clojure .attribute { 83 | color: #3E87E3; 84 | } 85 | 86 | pre .css .tag, 87 | pre .rules .property, 88 | pre .pseudo, 89 | pre .tex .special { 90 | color: #CDA869; 91 | } 92 | 93 | pre .css .class { 94 | color: #9B703F; 95 | } 96 | 97 | pre .rules .keyword { 98 | color: #C5AF75; 99 | } 100 | 101 | pre .rules .value { 102 | color: #CF6A4C; 103 | } 104 | 105 | pre .css .id { 106 | color: #8B98AB; 107 | } 108 | 109 | pre .annotation, 110 | pre .apache .sqbracket, 111 | pre .nginx .built_in { 112 | color: #9B859D; 113 | } 114 | 115 | pre .preprocessor, 116 | pre .pragma { 117 | color: #8996A8; 118 | } 119 | 120 | pre .hexcolor, 121 | pre .css .value .number { 122 | color: #DD7B3B; 123 | } 124 | 125 | pre .css .function { 126 | color: #DAD085; 127 | } 128 | 129 | pre .diff .header, 130 | pre .chunk, 131 | pre .tex .formula { 132 | background-color: #0E2231; 133 | color: #F8F8F8; 134 | font-style: italic; 135 | } 136 | 137 | pre .diff .change { 138 | background-color: #4A410D; 139 | color: #F8F8F8; 140 | } 141 | 142 | pre .addition { 143 | background-color: #253B22; 144 | color: #F8F8F8; 145 | } 146 | 147 | pre .deletion { 148 | background-color: #420E09; 149 | color: #F8F8F8; 150 | } 151 | 152 | pre .coffeescript .javascript, 153 | pre .javascript .xml, 154 | pre .tex .formula, 155 | pre .xml .javascript, 156 | pre .xml .vbscript, 157 | pre .xml .css, 158 | pre .xml .cdata { 159 | opacity: 0.5; 160 | } 161 | -------------------------------------------------------------------------------- /doc/_highlight/styles/tomorrow-night-blue.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Blue Theme */ 2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 5 | .tomorrow-comment, pre .comment, pre .title { 6 | color: #7285b7; 7 | } 8 | 9 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 10 | color: #ff9da4; 11 | } 12 | 13 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 14 | color: #ffc58f; 15 | } 16 | 17 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 18 | color: #ffeead; 19 | } 20 | 21 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 22 | color: #d1f1a9; 23 | } 24 | 25 | .tomorrow-aqua, pre .css .hexcolor { 26 | color: #99ffff; 27 | } 28 | 29 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 30 | color: #bbdaff; 31 | } 32 | 33 | .tomorrow-purple, pre .keyword, pre .javascript .function { 34 | color: #ebbbff; 35 | } 36 | 37 | pre code { 38 | display: block; 39 | background: #002451; 40 | color: white; 41 | padding: 0.5em; 42 | } 43 | 44 | pre .coffeescript .javascript, 45 | pre .javascript .xml, 46 | pre .tex .formula, 47 | pre .xml .javascript, 48 | pre .xml .vbscript, 49 | pre .xml .css, 50 | pre .xml .cdata { 51 | opacity: 0.5; 52 | } 53 | -------------------------------------------------------------------------------- /doc/_highlight/styles/tomorrow-night-bright.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Bright Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 4 | .tomorrow-comment, pre .comment, pre .title { 5 | color: #969896; 6 | } 7 | 8 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 9 | color: #d54e53; 10 | } 11 | 12 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 13 | color: #e78c45; 14 | } 15 | 16 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 17 | color: #e7c547; 18 | } 19 | 20 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 21 | color: #b9ca4a; 22 | } 23 | 24 | .tomorrow-aqua, pre .css .hexcolor { 25 | color: #70c0b1; 26 | } 27 | 28 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 29 | color: #7aa6da; 30 | } 31 | 32 | .tomorrow-purple, pre .keyword, pre .javascript .function { 33 | color: #c397d8; 34 | } 35 | 36 | pre code { 37 | display: block; 38 | background: black; 39 | color: #eaeaea; 40 | padding: 0.5em; 41 | } 42 | 43 | pre .coffeescript .javascript, 44 | pre .javascript .xml, 45 | pre .tex .formula, 46 | pre .xml .javascript, 47 | pre .xml .vbscript, 48 | pre .xml .css, 49 | pre .xml .cdata { 50 | opacity: 0.5; 51 | } 52 | -------------------------------------------------------------------------------- /doc/_highlight/styles/tomorrow-night-eighties.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Eighties Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 4 | .tomorrow-comment, pre .comment, pre .title { 5 | color: #999999; 6 | } 7 | 8 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 9 | color: #f2777a; 10 | } 11 | 12 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 13 | color: #f99157; 14 | } 15 | 16 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 17 | color: #ffcc66; 18 | } 19 | 20 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 21 | color: #99cc99; 22 | } 23 | 24 | .tomorrow-aqua, pre .css .hexcolor { 25 | color: #66cccc; 26 | } 27 | 28 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 29 | color: #6699cc; 30 | } 31 | 32 | .tomorrow-purple, pre .keyword, pre .javascript .function { 33 | color: #cc99cc; 34 | } 35 | 36 | pre code { 37 | display: block; 38 | background: #2d2d2d; 39 | color: #cccccc; 40 | padding: 0.5em; 41 | } 42 | 43 | pre .coffeescript .javascript, 44 | pre .javascript .xml, 45 | pre .tex .formula, 46 | pre .xml .javascript, 47 | pre .xml .vbscript, 48 | pre .xml .css, 49 | pre .xml .cdata { 50 | opacity: 0.5; 51 | } 52 | -------------------------------------------------------------------------------- /doc/_highlight/styles/tomorrow-night.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Theme */ 2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 5 | .tomorrow-comment, pre .comment, pre .title { 6 | color: #969896; 7 | } 8 | 9 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 10 | color: #cc6666; 11 | } 12 | 13 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 14 | color: #de935f; 15 | } 16 | 17 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 18 | color: #f0c674; 19 | } 20 | 21 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 22 | color: #b5bd68; 23 | } 24 | 25 | .tomorrow-aqua, pre .css .hexcolor { 26 | color: #8abeb7; 27 | } 28 | 29 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 30 | color: #81a2be; 31 | } 32 | 33 | .tomorrow-purple, pre .keyword, pre .javascript .function { 34 | color: #b294bb; 35 | } 36 | 37 | pre code { 38 | display: block; 39 | background: #1d1f21; 40 | color: #c5c8c6; 41 | padding: 0.5em; 42 | } 43 | 44 | pre .coffeescript .javascript, 45 | pre .javascript .xml, 46 | pre .tex .formula, 47 | pre .xml .javascript, 48 | pre .xml .vbscript, 49 | pre .xml .css, 50 | pre .xml .cdata { 51 | opacity: 0.5; 52 | } 53 | -------------------------------------------------------------------------------- /doc/_highlight/styles/tomorrow.css: -------------------------------------------------------------------------------- 1 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 2 | .tomorrow-comment, pre .comment, pre .title { 3 | color: #8e908c; 4 | } 5 | 6 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 7 | color: #c82829; 8 | } 9 | 10 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 11 | color: #f5871f; 12 | } 13 | 14 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 15 | color: #eab700; 16 | } 17 | 18 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 19 | color: #718c00; 20 | } 21 | 22 | .tomorrow-aqua, pre .css .hexcolor { 23 | color: #3e999f; 24 | } 25 | 26 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 27 | color: #4271ae; 28 | } 29 | 30 | .tomorrow-purple, pre .keyword, pre .javascript .function { 31 | color: #8959a8; 32 | } 33 | 34 | pre code { 35 | display: block; 36 | background: white; 37 | color: #4d4d4c; 38 | padding: 0.5em; 39 | } 40 | 41 | pre .coffeescript .javascript, 42 | pre .javascript .xml, 43 | pre .tex .formula, 44 | pre .xml .javascript, 45 | pre .xml .vbscript, 46 | pre .xml .css, 47 | pre .xml .cdata { 48 | opacity: 0.5; 49 | } 50 | -------------------------------------------------------------------------------- /doc/_highlight/styles/vs.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Visual Studio-like style based on original C# coloring by Jason Diamond 4 | 5 | */ 6 | pre code { 7 | display: block; padding: 0.5em; 8 | background: white; color: black; 9 | } 10 | 11 | pre .comment, 12 | pre .annotation, 13 | pre .template_comment, 14 | pre .diff .header, 15 | pre .chunk, 16 | pre .apache .cbracket { 17 | color: rgb(0, 128, 0); 18 | } 19 | 20 | pre .keyword, 21 | pre .id, 22 | pre .built_in, 23 | pre .smalltalk .class, 24 | pre .winutils, 25 | pre .bash .variable, 26 | pre .tex .command, 27 | pre .request, 28 | pre .status, 29 | pre .nginx .title, 30 | pre .xml .tag, 31 | pre .xml .tag .value { 32 | color: rgb(0, 0, 255); 33 | } 34 | 35 | pre .string, 36 | pre .title, 37 | pre .parent, 38 | pre .tag .value, 39 | pre .rules .value, 40 | pre .rules .value .number, 41 | pre .ruby .symbol, 42 | pre .ruby .symbol .string, 43 | pre .aggregate, 44 | pre .template_tag, 45 | pre .django .variable, 46 | pre .addition, 47 | pre .flow, 48 | pre .stream, 49 | pre .apache .tag, 50 | pre .date, 51 | pre .tex .formula, 52 | pre .coffeescript .attribute { 53 | color: rgb(163, 21, 21); 54 | } 55 | 56 | pre .ruby .string, 57 | pre .decorator, 58 | pre .filter .argument, 59 | pre .localvars, 60 | pre .array, 61 | pre .attr_selector, 62 | pre .pseudo, 63 | pre .pi, 64 | pre .doctype, 65 | pre .deletion, 66 | pre .envvar, 67 | pre .shebang, 68 | pre .preprocessor, 69 | pre .pragma, 70 | pre .userType, 71 | pre .apache .sqbracket, 72 | pre .nginx .built_in, 73 | pre .tex .special, 74 | pre .prompt { 75 | color: rgb(43, 145, 175); 76 | } 77 | 78 | pre .phpdoc, 79 | pre .javadoc, 80 | pre .xmlDocTag { 81 | color: rgb(128, 128, 128); 82 | } 83 | 84 | pre .vhdl .typename { font-weight: bold; } 85 | pre .vhdl .string { color: #666666; } 86 | pre .vhdl .literal { color: rgb(163, 21, 21); } 87 | pre .vhdl .attribute { color: #00B0E8; } 88 | 89 | pre .xml .attribute { color: rgb(255, 0, 0); } 90 | -------------------------------------------------------------------------------- /doc/_highlight/styles/xcode.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | XCode style (c) Angel Garcia 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #fff; color: black; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .javadoc, 15 | pre .comment * { 16 | color: rgb(0,106,0); 17 | } 18 | 19 | pre .keyword, 20 | pre .literal, 21 | pre .nginx .title { 22 | color: rgb(170,13,145); 23 | } 24 | pre .method, 25 | pre .list .title, 26 | pre .tag .title, 27 | pre .setting .value, 28 | pre .winutils, 29 | pre .tex .command, 30 | pre .http .title, 31 | pre .request, 32 | pre .status { 33 | color: #008; 34 | } 35 | 36 | pre .envvar, 37 | pre .tex .special { 38 | color: #660; 39 | } 40 | 41 | pre .string { 42 | color: rgb(196,26,22); 43 | } 44 | pre .tag .value, 45 | pre .cdata, 46 | pre .filter .argument, 47 | pre .attr_selector, 48 | pre .apache .cbracket, 49 | pre .date, 50 | pre .regexp { 51 | color: #080; 52 | } 53 | 54 | pre .sub .identifier, 55 | pre .pi, 56 | pre .tag, 57 | pre .tag .keyword, 58 | pre .decorator, 59 | pre .ini .title, 60 | pre .shebang, 61 | pre .prompt, 62 | pre .hexcolor, 63 | pre .rules .value, 64 | pre .css .value .number, 65 | pre .symbol, 66 | pre .symbol .string, 67 | pre .number, 68 | pre .css .function, 69 | pre .clojure .title, 70 | pre .clojure .built_in, 71 | pre .function .title, 72 | pre .coffeescript .attribute { 73 | color: rgb(28,0,207); 74 | } 75 | 76 | pre .class .title, 77 | pre .haskell .type, 78 | pre .smalltalk .class, 79 | pre .javadoctag, 80 | pre .yardoctag, 81 | pre .phpdoc, 82 | pre .typename, 83 | pre .tag .attribute, 84 | pre .doctype, 85 | pre .class .id, 86 | pre .built_in, 87 | pre .setting, 88 | pre .params, 89 | pre .clojure .attribute { 90 | color: rgb(92,38,153); 91 | } 92 | 93 | pre .variable { 94 | color: rgb(63,110,116); 95 | } 96 | pre .css .tag, 97 | pre .rules .property, 98 | pre .pseudo, 99 | pre .subst { 100 | color: #000; 101 | } 102 | 103 | pre .css .class, pre .css .id { 104 | color: #9B703F; 105 | } 106 | 107 | pre .value .important { 108 | color: #ff7700; 109 | font-weight: bold; 110 | } 111 | 112 | pre .rules .keyword { 113 | color: #C5AF75; 114 | } 115 | 116 | pre .annotation, 117 | pre .apache .sqbracket, 118 | pre .nginx .built_in { 119 | color: #9B859D; 120 | } 121 | 122 | pre .preprocessor, 123 | pre .preprocessor *, 124 | pre .pragma { 125 | color: rgb(100,56,32); 126 | } 127 | 128 | pre .tex .formula { 129 | background-color: #EEE; 130 | font-style: italic; 131 | } 132 | 133 | pre .diff .header, 134 | pre .chunk { 135 | color: #808080; 136 | font-weight: bold; 137 | } 138 | 139 | pre .diff .change { 140 | background-color: #BCCFF9; 141 | } 142 | 143 | pre .addition { 144 | background-color: #BAEEBA; 145 | } 146 | 147 | pre .deletion { 148 | background-color: #FFC8BD; 149 | } 150 | 151 | pre .comment .yardoctag { 152 | font-weight: bold; 153 | } 154 | 155 | pre .method .id { 156 | color: #000; 157 | } 158 | -------------------------------------------------------------------------------- /doc/_highlight/styles/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | pre code { 9 | display: block; padding: 0.5em; 10 | background: #3F3F3F; 11 | color: #DCDCDC; 12 | } 13 | 14 | pre .keyword, 15 | pre .tag, 16 | pre .css .class, 17 | pre .css .id, 18 | pre .lisp .title, 19 | pre .nginx .title, 20 | pre .request, 21 | pre .status, 22 | pre .clojure .attribute { 23 | color: #E3CEAB; 24 | } 25 | 26 | pre .django .template_tag, 27 | pre .django .variable, 28 | pre .django .filter .argument { 29 | color: #DCDCDC; 30 | } 31 | 32 | pre .number, 33 | pre .date { 34 | color: #8CD0D3; 35 | } 36 | 37 | pre .dos .envvar, 38 | pre .dos .stream, 39 | pre .variable, 40 | pre .apache .sqbracket { 41 | color: #EFDCBC; 42 | } 43 | 44 | pre .dos .flow, 45 | pre .diff .change, 46 | pre .python .exception, 47 | pre .python .built_in, 48 | pre .literal, 49 | pre .tex .special { 50 | color: #EFEFAF; 51 | } 52 | 53 | pre .diff .chunk, 54 | pre .subst { 55 | color: #8F8F8F; 56 | } 57 | 58 | pre .dos .keyword, 59 | pre .python .decorator, 60 | pre .title, 61 | pre .haskell .type, 62 | pre .diff .header, 63 | pre .ruby .class .parent, 64 | pre .apache .tag, 65 | pre .nginx .built_in, 66 | pre .tex .command, 67 | pre .prompt { 68 | color: #efef8f; 69 | } 70 | 71 | pre .dos .winutils, 72 | pre .ruby .symbol, 73 | pre .ruby .symbol .string, 74 | pre .ruby .string { 75 | color: #DCA3A3; 76 | } 77 | 78 | pre .diff .deletion, 79 | pre .string, 80 | pre .tag .value, 81 | pre .preprocessor, 82 | pre .pragma, 83 | pre .built_in, 84 | pre .sql .aggregate, 85 | pre .javadoc, 86 | pre .smalltalk .class, 87 | pre .smalltalk .localvars, 88 | pre .smalltalk .array, 89 | pre .css .rules .value, 90 | pre .attr_selector, 91 | pre .pseudo, 92 | pre .apache .cbracket, 93 | pre .tex .formula, 94 | pre .coffeescript .attribute { 95 | color: #CC9393; 96 | } 97 | 98 | pre .shebang, 99 | pre .diff .addition, 100 | pre .comment, 101 | pre .java .annotation, 102 | pre .template_comment, 103 | pre .pi, 104 | pre .doctype { 105 | color: #7F9F7F; 106 | } 107 | 108 | pre .coffeescript .javascript, 109 | pre .javascript .xml, 110 | pre .tex .formula, 111 | pre .xml .javascript, 112 | pre .xml .vbscript, 113 | pre .xml .css, 114 | pre .xml .cdata { 115 | opacity: 0.5; 116 | } 117 | 118 | -------------------------------------------------------------------------------- /doc/_markdown/signal/README.md: -------------------------------------------------------------------------------- 1 | torch-signal 2 | ============ 3 | - Fourier Transforms (real & complex) (1D, 2D, 3D) 4 | - Cosine Transforms (1D, 2D, 3D) 5 | - Short-time Fourier Transforms 6 | - Spectrogram 7 | - Hilbert Transform 8 | - Complex Cepstral Analysis, Real Cepstrums 9 | 10 | 11 | Quickstart 12 | ---------- 13 | Install fftw3 on your OS: 14 | 15 | OSX (Homebrew): 16 | ```bash 17 | brew install fftw 18 | ``` 19 | 20 | Ubuntu: 21 | ```bash 22 | sudo apt-get install libfftw3 23 | ``` 24 | 25 | Install torch-signal: 26 | ```bash 27 | luarocks install https://raw.github.com/soumith/torch-signal/master/rocks/signal-scm-1.rockspec 28 | ``` 29 | 30 | (add sudo for ubuntu) 31 | 32 | For documentation, go to: 33 | http://soumith.github.io/torch-signal/signal/ 34 | 35 | For examples, see tests/ 36 | -------------------------------------------------------------------------------- /doc/_markdown/signal/complex.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### complex.lua ### 4 | 5 | All functions in here expect either a 2D Nx2 Complex tensor 6 | 7 | 8 | [src] 9 | 10 | 11 | 12 | ### signal.complex.poly(x) ### 13 | 14 | Polynomial with specified roots 15 | 16 | Function is super unoptimized 17 | 18 | 19 | #### Undocumented methods #### 20 | 21 | 22 | * `signal.complex.angle(h)` 23 | 24 | * `signal.complex.exp(h)` 25 | 26 | * `signal.complex.abs(h)` 27 | 28 | * `signal.complex.real(h)` 29 | 30 | * `signal.complex.imag(h)` 31 | 32 | * `signal.complex.conj(h)` 33 | 34 | * `signal.complex.prod(h)` 35 | 36 | * `signal.complex.cmul(a1,b1, noargcheck)` 37 | 38 | * `signal.complex.dot(a,b)` 39 | 40 | * `signal.complex.mm(a,b)` 41 | 42 | * `signal.complex.diag(x)` 43 | -------------------------------------------------------------------------------- /doc/_markdown/signal/convolution.md: -------------------------------------------------------------------------------- 1 | 2 | [src] 3 | 4 | 5 | 6 | ### signal.conv1d(input, kernel, stride [, mode]) ### 7 | 8 | 1D convolution with specified stride. `mode` is `"valid"` by default, supported modes are `"valid"` and `"same"`. 9 | 10 | Note: unlike the `conv` function in MATLAB/Octave, this function does not reverse the kernel. 11 | -------------------------------------------------------------------------------- /doc/_markdown/signal/extramath.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### extramath.lua ### 4 | 5 | some extra math functions 6 | 7 | 8 | 9 | #### Undocumented methods #### 10 | 11 | 12 | * `signal.xmath.round(num)` 13 | 14 | * `signal.xmath.log2(x)` 15 | 16 | * `signal.xmath.nextpow2(x)` 17 | -------------------------------------------------------------------------------- /doc/_markdown/signal/ffi.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soumith/torch-signal/14479a9c1bf70f90a5267ed5aa30a34e1a9effd3/doc/_markdown/signal/ffi.md -------------------------------------------------------------------------------- /doc/_markdown/signal/fft.md: -------------------------------------------------------------------------------- 1 | 2 | [src] 3 | 4 | 5 | 6 | ### signal.fft(input) ### 7 | 8 | 1D FFT 9 | Takes Real inputs (1D tensor of N points) 10 | or complex inputs 2D tensor of (Nx2) size for N points 11 | 12 | Output matches with matlab output 13 | 14 | [src] 15 | 16 | 17 | 18 | ### signal.ifft(input) ### 19 | 20 | inverse 1D FFT 21 | Takes Real inputs (1D tensor of N points) 22 | or complex inputs 2D tensor of (Nx2) size for N points 23 | 24 | Output matches with matlab output 25 | 26 | [src] 27 | 28 | 29 | 30 | ### signal.rfft(input) ### 31 | 32 | real to complex dft. 33 | This function retains only the positive frequencies. 34 | Input is a 1D real tensor 35 | Output is 2D complex tensor of size (input:size(1)/2 + 1, 2) 36 | 37 | [src] 38 | 39 | 40 | 41 | ### signal.irfft(input) ### 42 | 43 | complex to real dft. This function is the exact inverse of signal.rfft 44 | 45 | [src] 46 | 47 | 48 | 49 | ### signal.fft2(input) ### 50 | 51 | 2D FFT 52 | Takes Real inputs (2D tensor of NxM points) 53 | or complex inputs 3D tensor of (NxMx2) size for NxM points 54 | 55 | Output matches with matlab output 56 | 57 | [src] 58 | 59 | 60 | 61 | ### signal.ifft2(input) ### 62 | 63 | 2D Inverse FFT 64 | Takes Real inputs (2D tensor of NxM points) 65 | or complex inputs 3D tensor of (NxMx2) size for NxM points 66 | 67 | Output matches with matlab output 68 | 69 | [src] 70 | 71 | 72 | 73 | ### signal.fft3(input) ### 74 | 75 | 3D FFT 76 | Takes Real inputs (3D tensor of NxMxP points) 77 | or complex inputs 4D tensor of (NxMxPx2) size for NxMxP points 78 | 79 | Output matches with matlab output 80 | 81 | [src] 82 | 83 | 84 | 85 | ### signal.ifft3(input) ### 86 | 87 | 3D Inverse FFT 88 | Takes Real inputs (3D tensor of NxMxP points) 89 | or complex inputs 4D tensor of (NxMxPx2) size for NxMxP points 90 | 91 | Output matches with matlab output 92 | 93 | [src] 94 | 95 | 96 | 97 | ### signal.hann(L, flag) ### 98 | 99 | returns an L-point Hann window in a 1D tensor. L must be a positive integer. 100 | When 'periodic' is specified, hann computes a length L+1 window and returns the first L points. 101 | flag: 'periodic' or 'symmetric'. 'symmetric' is default 102 | 103 | Output matches with matlab output 104 | 105 | [src] 106 | 107 | 108 | 109 | ### signal.blackman(N, flag) ### 110 | 111 | returns an N-point Blackman window in a 1D tensor. 112 | N must be a positive integer. 113 | When 'periodic' is specified, computes a length N+1 window and returns the first N points. 114 | flag: 'periodic' or 'symmetric'. 'symmetric' is default 115 | 116 | Output matches with matlab output 117 | 118 | [src] 119 | 120 | 121 | 122 | ### signal.blackmanharris(N, flag) ### 123 | 124 | returns an N-point minimum 4-term Blackman-Harris window in a 1D tensor. 125 | The window is minimum in the sense that its maximum sidelobes are minimized. 126 | N must be a positive integer. 127 | flag: 'periodic' or 'symmetric'. 'symmetric' is default 128 | 129 | Output matches with matlab output 130 | 131 | [src] 132 | 133 | 134 | 135 | ### signal.stft(input, window_size, window_stride, window_type) ### 136 | 137 | 1D complex short-time fourier transforms 138 | Run a window across your signal and calculate fourier transforms on that window. 139 | To make sure that the windows are not discontinuous at the edges, you can optionally apply a window preprocessor. 140 | The available window preprocessors are: hamming, hann, bartlett 141 | 142 | [src] 143 | 144 | 145 | 146 | ### signal.rstft(input, window_size, window_stride, window_type) ### 147 | 148 | 1D real short-time fourier transforms 149 | Run a window across your signal and calculate fourier transforms on that window. 150 | To make sure that the windows are not discontinuous at the edges, you can optionally apply a window preprocessor. 151 | rfft is used for fourier transform, so only the positive frequencies are retained 152 | The available window preprocessors are: hamming, hann, bartlett 153 | 154 | [src] 155 | 156 | 157 | 158 | ### signal.spectrogram(inp, window_size, window_stride) ### 159 | 160 | Takes the rstft(x) and generates a pretty spectrogram by 161 | taking the magnitude of the stft, and applying a (natural log * 10) 162 | Also transposes the output, to have time on the X axis. 163 | 164 | [src] 165 | 166 | 167 | 168 | ### signal.unwrap(a, tol) ### 169 | 170 | Correct phase angles to produce smoother phase plots 171 | Unwrap radian phases by adding multiples of 2*pi as appropriate to 172 | remove jumps greater than **tol**. **tol** defaults to pi. 173 | 174 | Output matches with matlab output 175 | 176 | [src] 177 | 178 | 179 | 180 | ### signal.rcunwrap(x) ### 181 | 182 | unwraps the phase and removes phase corresponding to integer lag. 183 | 184 | Output matches with matlab output 185 | 186 | [src] 187 | 188 | 189 | 190 | ### signal.rcwrap(y, nd) ### 191 | 192 | Adds phase corresponding to integer lag 193 | 194 | Output matches with matlab output 195 | 196 | [src] 197 | 198 | 199 | 200 | ### signal.cceps(x) ### 201 | 202 | 1D Complex cepstral analysis 203 | Returns the cepstrum and a phase shift factor "nd" that is useful to invert the signal back. 204 | 205 | Output matches with matlab output 206 | 207 | [src] 208 | 209 | 210 | 211 | ### signal.icceps(xhat,nd) ### 212 | 213 | 1D Inverse Complex cepstral analysis. 214 | Takes in the outputs of cceps to produce the input signal back 215 | 216 | Output matches with matlab output 217 | 218 | [src] 219 | 220 | 221 | 222 | ### signal.rceps(x) ### 223 | 224 | Real cepstrum and minimum phase reconstruction 225 | The real cepstrum is the inverse Fourier transform of the real logarithm of the magnitude of the Fourier transform of a sequence. 226 | 227 | Output matches with matlab output 228 | 229 | [src] 230 | 231 | 232 | 233 | ### signal.dct(input) ### 234 | 235 | 1D Discrete Cosine Transform (DCT) 236 | Takes Real inputs (1D tensor of N points) 237 | 238 | To see what is exactly computed, see section REDFT10 over here: 239 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html 240 | 241 | [src] 242 | 243 | 244 | 245 | ### signal.idct(input) ### 246 | 247 | inverse 1D Discrete Cosine Transform (DCT) 248 | Takes Real inputs (1D tensor of N points) 249 | 250 | To see what is exactly computed, see section REDFT01 over here: 251 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html 252 | 253 | [src] 254 | 255 | 256 | 257 | ### signal.dct2(input) ### 258 | 259 | 2D Discrete Cosine Transform (DCT) 260 | Takes Real inputs (2D tensor of NxM points) 261 | 262 | To see what is exactly computed, see section REDFT10 over here: 263 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html 264 | 265 | [src] 266 | 267 | 268 | 269 | ### signal.idct2(input) ### 270 | 271 | inverse 2D Discrete Cosine Transform (DCT) 272 | Takes Real inputs (2D tensor of NxM points) 273 | 274 | To see what is exactly computed, see section REDFT01 over here: 275 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html 276 | 277 | [src] 278 | 279 | 280 | 281 | ### signal.dct3(input) ### 282 | 283 | 3D Discrete Cosine Transform (DCT) 284 | Takes Real inputs (3D tensor of NxMXP points) 285 | 286 | To see what is exactly computed, see section REDFT10 over here: 287 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html 288 | 289 | [src] 290 | 291 | 292 | 293 | ### signal.idct3(input) ### 294 | 295 | inverse 3D Discrete Cosine Transform (DCT) 296 | Takes Real inputs (3D tensor of NxMxP points) 297 | 298 | To see what is exactly computed, see section REDFT01 over here: 299 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html 300 | 301 | [src] 302 | 303 | 304 | 305 | ### signal.hilbert(xr) ### 306 | 307 | Discrete-time analytic signal using Hilbert transform 308 | Takes 1D inputs 309 | 310 | Output matches with matlab output 311 | 312 | 313 | #### Undocumented methods #### 314 | 315 | 316 | * `signal.typecheck(input)` 317 | -------------------------------------------------------------------------------- /doc/_markdown/signal/init.md: -------------------------------------------------------------------------------- 1 | keep the loaded C object around, so that it doesn't get garbage collected 2 | 3 | -------------------------------------------------------------------------------- /doc/_markdown/signal/wavelet.md: -------------------------------------------------------------------------------- 1 | 2 | [src] 3 | 4 | 5 | 6 | ### signal.wavelet.haar1d() ### 7 | 8 | Haar wavelet (1D) 9 | return the phi and psi functions of a haar wavelet 10 | 11 | [src] 12 | 13 | 14 | 15 | ### signal.wavelet.daubechies1d() ### 16 | 17 | 18 | Daubechies wavelet (1D) 19 | return the phi and psi functions of a daubechies wavelet 20 | 21 | 22 | [src] 23 | 24 | 25 | 26 | ### signal.wavelet.dwt1d(input, phi, psi, maxlevels) ### 27 | 28 | Calculates the discrete wavelet transform, given the phi and psi functions 29 | phi and psi are functions that take the input signal and give out the 30 | scaled signal, and the wavelet coefficients respectively. 31 | 32 | input - input signal 33 | \phi φ(x) - scaling function 34 | \psi ψ(x) - wavelet function 35 | [maxlevels] - maximum number of levels to recurse 36 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Available docs 4 | 5 | 6 | 7 | 8 | 9 | 10 |

Available docs

11 |
12 |

Miscellaneous

signal
13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /doc/search.js: -------------------------------------------------------------------------------- 1 | function _ifNotFileProtocol(callback) { 2 | $(document).ready(function() { 3 | var url = window.location.href 4 | var protocol = url.split("/")[0]; 5 | if (protocol != "file:") { 6 | callback(); 7 | } 8 | }); 9 | } 10 | 11 | function _searchForm() { 12 | return '
\ 13 |
\ 14 | \ 15 | \ 16 |
\ 17 |
' 18 | } 19 | 20 | function addSearchFormHeader() 21 | { 22 | _ifNotFileProtocol(function() { 23 | $("header > ul").append('
  • ' + _searchForm() + '
  • '); 24 | }); 25 | } 26 | 27 | function addSearchFormBody(parentElement) { 28 | _ifNotFileProtocol(function() { 29 | $("body").prepend(_searchForm()); 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /doc/signal/complex.html: -------------------------------------------------------------------------------- 1 |

    complex.lua

    2 | 3 |

    All functions in here expect either a 2D Nx2 Complex tensor

    4 | 5 |

    [src] 6 |

    7 | 8 |

    signal.complex.poly(x)

    9 | 10 |

    Polynomial with specified roots

    11 | 12 |

    Function is super unoptimized

    13 | 14 |

    Undocumented methods

    15 | 16 |

    17 | 18 |
      19 |
    • signal.complex.angle(h) 20 |
    • 21 |
    • signal.complex.exp(h) 22 |
    • 23 |
    • signal.complex.abs(h) 24 |
    • 25 |
    • signal.complex.real(h) 26 |
    • 27 |
    • signal.complex.imag(h) 28 |
    • 29 |
    • signal.complex.conj(h) 30 |
    • 31 |
    • signal.complex.prod(h) 32 |
    • 33 |
    • signal.complex.cmul(a1,b1, noargcheck) 34 |
    • 35 |
    • signal.complex.dot(a,b) 36 |
    • 37 |
    • signal.complex.mm(a,b) 38 |
    • 39 |
    • signal.complex.diag(x)
    • 40 |
    41 | -------------------------------------------------------------------------------- /doc/signal/convolution.html: -------------------------------------------------------------------------------- 1 |

    [src] 2 |

    3 | 4 |

    signal.conv1d(input, kernel, stride)

    5 | 6 |

    1D valid convolution with stride

    7 | -------------------------------------------------------------------------------- /doc/signal/extra/README.html: -------------------------------------------------------------------------------- 1 |

    torch-signal

    2 | 3 |
      4 |
    • Fourier Transforms (real & complex) (1D, 2D, 3D)
    • 5 |
    • Cosine Transforms (1D, 2D, 3D)
    • 6 |
    • Short-time Fourier Transforms
    • 7 |
    • Spectrogram
    • 8 |
    • Hilbert Transform
    • 9 |
    • Complex Cepstral Analysis, Real Cepstrums
    • 10 |
    11 | 12 |

    Quickstart

    13 | 14 |

    Install fftw3 on your OS:

    15 | 16 |

    OSX (Homebrew):

    17 | 18 |
    brew install fftw
    19 | 
    20 | 21 |

    Ubuntu:

    22 | 23 |
    sudo apt-get install libfftw3
    24 | 
    25 | 26 |

    Install torch-signal:

    27 | 28 |
    luarocks install https://raw.github.com/soumith/torch-signal/master/rocks/signal-scm-1.rockspec
    29 | 
    30 | 31 |

    (add sudo for ubuntu)

    32 | 33 |

    For documentation, go to: 34 | http://soumith.github.io/torch-signal/signal/

    35 | 36 |

    For examples, see tests/

    37 | -------------------------------------------------------------------------------- /doc/signal/extramath.html: -------------------------------------------------------------------------------- 1 |

    extramath.lua

    2 | 3 |

    some extra math functions

    4 | 5 |

    Undocumented methods

    6 | 7 |

    8 | 9 |
      10 |
    • signal.xmath.round(num) 11 |
    • 12 |
    • signal.xmath.log2(x) 13 |
    • 14 |
    • signal.xmath.nextpow2(x)
    • 15 |
    16 | -------------------------------------------------------------------------------- /doc/signal/ffi.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soumith/torch-signal/14479a9c1bf70f90a5267ed5aa30a34e1a9effd3/doc/signal/ffi.html -------------------------------------------------------------------------------- /doc/signal/fft.html: -------------------------------------------------------------------------------- 1 |

    [src] 2 |

    3 | 4 |

    signal.fft(input)

    5 | 6 |

    1D FFT 7 | Takes Real inputs (1D tensor of N points) 8 | or complex inputs 2D tensor of (Nx2) size for N points

    9 | 10 |

    Output matches with matlab output

    11 | 12 |

    [src] 13 |

    14 | 15 |

    signal.ifft(input)

    16 | 17 |

    inverse 1D FFT 18 | Takes Real inputs (1D tensor of N points) 19 | or complex inputs 2D tensor of (Nx2) size for N points

    20 | 21 |

    Output matches with matlab output

    22 | 23 |

    [src] 24 |

    25 | 26 |

    signal.rfft(input)

    27 | 28 |

    real to complex dft. 29 | This function retains only the positive frequencies. 30 | Input is a 1D real tensor 31 | Output is 2D complex tensor of size (input:size(1)/2 + 1, 2)

    32 | 33 |

    [src] 34 |

    35 | 36 |

    signal.irfft(input)

    37 | 38 |

    complex to real dft. This function is the exact inverse of signal.rfft

    39 | 40 |

    [src] 41 |

    42 | 43 |

    signal.fft2(input)

    44 | 45 |

    2D FFT 46 | Takes Real inputs (2D tensor of NxM points) 47 | or complex inputs 3D tensor of (NxMx2) size for NxM points

    48 | 49 |

    Output matches with matlab output

    50 | 51 |

    [src] 52 |

    53 | 54 |

    signal.ifft2(input)

    55 | 56 |

    2D Inverse FFT 57 | Takes Real inputs (2D tensor of NxM points) 58 | or complex inputs 3D tensor of (NxMx2) size for NxM points

    59 | 60 |

    Output matches with matlab output

    61 | 62 |

    [src] 63 |

    64 | 65 |

    signal.fft3(input)

    66 | 67 |

    3D FFT 68 | Takes Real inputs (3D tensor of NxMxP points) 69 | or complex inputs 4D tensor of (NxMxPx2) size for NxMxP points

    70 | 71 |

    Output matches with matlab output

    72 | 73 |

    [src] 74 |

    75 | 76 |

    signal.ifft3(input)

    77 | 78 |

    3D Inverse FFT 79 | Takes Real inputs (3D tensor of NxMxP points) 80 | or complex inputs 4D tensor of (NxMxPx2) size for NxMxP points

    81 | 82 |

    Output matches with matlab output

    83 | 84 |

    [src] 85 |

    86 | 87 |

    signal.hann(L, flag)

    88 | 89 |

    returns an L-point Hann window in a 1D tensor. L must be a positive integer. 90 | When 'periodic' is specified, hann computes a length L+1 window and returns the first L points. 91 | flag: 'periodic' or 'symmetric'. 'symmetric' is default

    92 | 93 |

    Output matches with matlab output

    94 | 95 |

    [src] 96 |

    97 | 98 |

    signal.blackman(N, flag)

    99 | 100 |

    returns an N-point Blackman window in a 1D tensor. 101 | N must be a positive integer. 102 | When 'periodic' is specified, computes a length N+1 window and returns the first N points. 103 | flag: 'periodic' or 'symmetric'. 'symmetric' is default

    104 | 105 |

    Output matches with matlab output

    106 | 107 |

    [src] 108 |

    109 | 110 |

    signal.blackmanharris(N, flag)

    111 | 112 |

    returns an N-point minimum 4-term Blackman-Harris window in a 1D tensor. 113 | The window is minimum in the sense that its maximum sidelobes are minimized. 114 | N must be a positive integer.
    115 | flag: 'periodic' or 'symmetric'. 'symmetric' is default

    116 | 117 |

    Output matches with matlab output

    118 | 119 |

    [src] 120 |

    121 | 122 |

    signal.stft(input, window_size, window_stride, window_type)

    123 | 124 |

    1D complex short-time fourier transforms 125 | Run a window across your signal and calculate fourier transforms on that window. 126 | To make sure that the windows are not discontinuous at the edges, you can optionally apply a window preprocessor. 127 | The available window preprocessors are: hamming, hann, bartlett

    128 | 129 |

    [src] 130 |

    131 | 132 |

    signal.rstft(input, window_size, window_stride, window_type)

    133 | 134 |

    1D real short-time fourier transforms 135 | Run a window across your signal and calculate fourier transforms on that window. 136 | To make sure that the windows are not discontinuous at the edges, you can optionally apply a window preprocessor. 137 | rfft is used for fourier transform, so only the positive frequencies are retained 138 | The available window preprocessors are: hamming, hann, bartlett

    139 | 140 |

    [src] 141 |

    142 | 143 |

    signal.spectrogram(inp, window_size, window_stride)

    144 | 145 |

    Takes the rstft(x) and generates a pretty spectrogram by 146 | taking the magnitude of the stft, and applying a (natural log * 10) 147 | Also transposes the output, to have time on the X axis.

    148 | 149 |

    [src] 150 |

    151 | 152 |

    signal.unwrap(a, tol)

    153 | 154 |

    Correct phase angles to produce smoother phase plots
    155 | Unwrap radian phases by adding multiples of 2*pi as appropriate to 156 | remove jumps greater than tol. tol defaults to pi.

    157 | 158 |

    Output matches with matlab output

    159 | 160 |

    [src] 161 |

    162 | 163 |

    signal.rcunwrap(x)

    164 | 165 |

    unwraps the phase and removes phase corresponding to integer lag.

    166 | 167 |

    Output matches with matlab output

    168 | 169 |

    [src] 170 |

    171 | 172 |

    signal.rcwrap(y, nd)

    173 | 174 |

    Adds phase corresponding to integer lag

    175 | 176 |

    Output matches with matlab output

    177 | 178 |

    [src] 179 |

    180 | 181 |

    signal.cceps(x)

    182 | 183 |

    1D Complex cepstral analysis 184 | Returns the cepstrum and a phase shift factor "nd" that is useful to invert the signal back.

    185 | 186 |

    Output matches with matlab output

    187 | 188 |

    [src] 189 |

    190 | 191 |

    signal.icceps(xhat,nd)

    192 | 193 |

    1D Inverse Complex cepstral analysis. 194 | Takes in the outputs of cceps to produce the input signal back

    195 | 196 |

    Output matches with matlab output

    197 | 198 |

    [src] 199 |

    200 | 201 |

    signal.rceps(x)

    202 | 203 |

    Real cepstrum and minimum phase reconstruction 204 | The real cepstrum is the inverse Fourier transform of the real logarithm of the magnitude of the Fourier transform of a sequence.

    205 | 206 |

    Output matches with matlab output

    207 | 208 |

    [src] 209 |

    210 | 211 |

    signal.dct(input)

    212 | 213 |

    1D Discrete Cosine Transform (DCT) 214 | Takes Real inputs (1D tensor of N points)

    215 | 216 |

    To see what is exactly computed, see section REDFT10 over here: 217 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    218 | 219 |

    [src] 220 |

    221 | 222 |

    signal.idct(input)

    223 | 224 |

    inverse 1D Discrete Cosine Transform (DCT) 225 | Takes Real inputs (1D tensor of N points)

    226 | 227 |

    To see what is exactly computed, see section REDFT01 over here: 228 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    229 | 230 |

    [src] 231 |

    232 | 233 |

    signal.dct2(input)

    234 | 235 |

    2D Discrete Cosine Transform (DCT) 236 | Takes Real inputs (2D tensor of NxM points)

    237 | 238 |

    To see what is exactly computed, see section REDFT10 over here: 239 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    240 | 241 |

    [src] 242 |

    243 | 244 |

    signal.idct2(input)

    245 | 246 |

    inverse 2D Discrete Cosine Transform (DCT) 247 | Takes Real inputs (2D tensor of NxM points)

    248 | 249 |

    To see what is exactly computed, see section REDFT01 over here: 250 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    251 | 252 |

    [src] 253 |

    254 | 255 |

    signal.dct3(input)

    256 | 257 |

    3D Discrete Cosine Transform (DCT) 258 | Takes Real inputs (3D tensor of NxMXP points)

    259 | 260 |

    To see what is exactly computed, see section REDFT10 over here: 261 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    262 | 263 |

    [src] 264 |

    265 | 266 |

    signal.idct3(input)

    267 | 268 |

    inverse 3D Discrete Cosine Transform (DCT) 269 | Takes Real inputs (3D tensor of NxMxP points)

    270 | 271 |

    To see what is exactly computed, see section REDFT01 over here: 272 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    273 | 274 |

    [src] 275 |

    276 | 277 |

    signal.hilbert(xr)

    278 | 279 |

    Discrete-time analytic signal using Hilbert transform 280 | Takes 1D inputs

    281 | 282 |

    Output matches with matlab output

    283 | 284 |

    Undocumented methods

    285 | 286 |

    287 | 288 |
      289 |
    • signal.typecheck(input)
    • 290 |
    291 | -------------------------------------------------------------------------------- /doc/signal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | signal - Documentation 5 | 23 | 24 | 25 | 26 | 27 | 37 | 38 | 39 | 40 | 41 | 42 | 55 | 56 | 57 |
    58 | 63 |
    64 |
    65 | 165 |
    166 |

    torch-signal

    167 | 168 |
      169 |
    • Fourier Transforms (real & complex) (1D, 2D, 3D)
    • 170 |
    • Cosine Transforms (1D, 2D, 3D)
    • 171 |
    • Short-time Fourier Transforms
    • 172 |
    • Spectrogram
    • 173 |
    • Hilbert Transform
    • 174 |
    • Complex Cepstral Analysis, Real Cepstrums
    • 175 |
    176 | 177 |

    Quickstart

    178 | 179 |

    Install fftw3 on your OS:

    180 | 181 |

    OSX (Homebrew):

    182 | 183 |
    brew install fftw
    184 | 
    185 | 186 |

    Ubuntu:

    187 | 188 |
    sudo apt-get install libfftw3
    189 | 
    190 | 191 |

    Install torch-signal:

    192 | 193 |
    luarocks install https://raw.github.com/soumith/torch-signal/master/rocks/signal-scm-1.rockspec
    194 | 
    195 | 196 |

    (add sudo for ubuntu)

    197 | 198 |

    For documentation, go to: 199 | http://soumith.github.io/torch-signal/signal/

    200 | 201 |

    For examples, see tests/

    202 |

    keep the loaded C object around, so that it doesn't get garbage collected

    203 |

    complex.lua

    204 | 205 |

    All functions in here expect either a 2D Nx2 Complex tensor

    206 | 207 |

    [src] 208 |

    209 | 210 |

    signal.complex.poly(x)

    211 | 212 |

    Polynomial with specified roots

    213 | 214 |

    Function is super unoptimized

    215 | 216 |

    Undocumented methods

    217 | 218 |

    219 | 220 |
      221 |
    • signal.complex.angle(h) 222 |
    • 223 |
    • signal.complex.exp(h) 224 |
    • 225 |
    • signal.complex.abs(h) 226 |
    • 227 |
    • signal.complex.real(h) 228 |
    • 229 |
    • signal.complex.imag(h) 230 |
    • 231 |
    • signal.complex.conj(h) 232 |
    • 233 |
    • signal.complex.prod(h) 234 |
    • 235 |
    • signal.complex.cmul(a1,b1, noargcheck) 236 |
    • 237 |
    • signal.complex.dot(a,b) 238 |
    • 239 |
    • signal.complex.mm(a,b) 240 |
    • 241 |
    • signal.complex.diag(x)
    • 242 |
    243 |

    [src] 244 |

    245 | 246 |

    signal.conv1d(input, kernel, stride)

    247 | 248 |

    1D valid convolution with stride

    249 |

    extramath.lua

    250 | 251 |

    some extra math functions

    252 | 253 |

    Undocumented methods

    254 | 255 |

    256 | 257 |
      258 |
    • signal.xmath.round(num) 259 |
    • 260 |
    • signal.xmath.log2(x) 261 |
    • 262 |
    • signal.xmath.nextpow2(x)
    • 263 |
    264 |

    [src] 265 |

    266 | 267 |

    signal.fft(input)

    268 | 269 |

    1D FFT 270 | Takes Real inputs (1D tensor of N points) 271 | or complex inputs 2D tensor of (Nx2) size for N points

    272 | 273 |

    Output matches with matlab output

    274 | 275 |

    [src] 276 |

    277 | 278 |

    signal.ifft(input)

    279 | 280 |

    inverse 1D FFT 281 | Takes Real inputs (1D tensor of N points) 282 | or complex inputs 2D tensor of (Nx2) size for N points

    283 | 284 |

    Output matches with matlab output

    285 | 286 |

    [src] 287 |

    288 | 289 |

    signal.rfft(input)

    290 | 291 |

    real to complex dft. 292 | This function retains only the positive frequencies. 293 | Input is a 1D real tensor 294 | Output is 2D complex tensor of size (input:size(1)/2 + 1, 2)

    295 | 296 |

    [src] 297 |

    298 | 299 |

    signal.irfft(input)

    300 | 301 |

    complex to real dft. This function is the exact inverse of signal.rfft

    302 | 303 |

    [src] 304 |

    305 | 306 |

    signal.fft2(input)

    307 | 308 |

    2D FFT 309 | Takes Real inputs (2D tensor of NxM points) 310 | or complex inputs 3D tensor of (NxMx2) size for NxM points

    311 | 312 |

    Output matches with matlab output

    313 | 314 |

    [src] 315 |

    316 | 317 |

    signal.ifft2(input)

    318 | 319 |

    2D Inverse FFT 320 | Takes Real inputs (2D tensor of NxM points) 321 | or complex inputs 3D tensor of (NxMx2) size for NxM points

    322 | 323 |

    Output matches with matlab output

    324 | 325 |

    [src] 326 |

    327 | 328 |

    signal.fft3(input)

    329 | 330 |

    3D FFT 331 | Takes Real inputs (3D tensor of NxMxP points) 332 | or complex inputs 4D tensor of (NxMxPx2) size for NxMxP points

    333 | 334 |

    Output matches with matlab output

    335 | 336 |

    [src] 337 |

    338 | 339 |

    signal.ifft3(input)

    340 | 341 |

    3D Inverse FFT 342 | Takes Real inputs (3D tensor of NxMxP points) 343 | or complex inputs 4D tensor of (NxMxPx2) size for NxMxP points

    344 | 345 |

    Output matches with matlab output

    346 | 347 |

    [src] 348 |

    349 | 350 |

    signal.hann(L, flag)

    351 | 352 |

    returns an L-point Hann window in a 1D tensor. L must be a positive integer. 353 | When 'periodic' is specified, hann computes a length L+1 window and returns the first L points. 354 | flag: 'periodic' or 'symmetric'. 'symmetric' is default

    355 | 356 |

    Output matches with matlab output

    357 | 358 |

    [src] 359 |

    360 | 361 |

    signal.blackman(N, flag)

    362 | 363 |

    returns an N-point Blackman window in a 1D tensor. 364 | N must be a positive integer. 365 | When 'periodic' is specified, computes a length N+1 window and returns the first N points. 366 | flag: 'periodic' or 'symmetric'. 'symmetric' is default

    367 | 368 |

    Output matches with matlab output

    369 | 370 |

    [src] 371 |

    372 | 373 |

    signal.blackmanharris(N, flag)

    374 | 375 |

    returns an N-point minimum 4-term Blackman-Harris window in a 1D tensor. 376 | The window is minimum in the sense that its maximum sidelobes are minimized. 377 | N must be a positive integer.
    378 | flag: 'periodic' or 'symmetric'. 'symmetric' is default

    379 | 380 |

    Output matches with matlab output

    381 | 382 |

    [src] 383 |

    384 | 385 |

    signal.stft(input, window_size, window_stride, window_type)

    386 | 387 |

    1D complex short-time fourier transforms 388 | Run a window across your signal and calculate fourier transforms on that window. 389 | To make sure that the windows are not discontinuous at the edges, you can optionally apply a window preprocessor. 390 | The available window preprocessors are: hamming, hann, bartlett

    391 | 392 |

    [src] 393 |

    394 | 395 |

    signal.rstft(input, window_size, window_stride, window_type)

    396 | 397 |

    1D real short-time fourier transforms 398 | Run a window across your signal and calculate fourier transforms on that window. 399 | To make sure that the windows are not discontinuous at the edges, you can optionally apply a window preprocessor. 400 | rfft is used for fourier transform, so only the positive frequencies are retained 401 | The available window preprocessors are: hamming, hann, bartlett

    402 | 403 |

    [src] 404 |

    405 | 406 |

    signal.spectrogram(inp, window_size, window_stride)

    407 | 408 |

    Takes the rstft(x) and generates a pretty spectrogram by 409 | taking the magnitude of the stft, and applying a (natural log * 10) 410 | Also transposes the output, to have time on the X axis.

    411 | 412 |

    [src] 413 |

    414 | 415 |

    signal.unwrap(a, tol)

    416 | 417 |

    Correct phase angles to produce smoother phase plots
    418 | Unwrap radian phases by adding multiples of 2*pi as appropriate to 419 | remove jumps greater than tol. tol defaults to pi.

    420 | 421 |

    Output matches with matlab output

    422 | 423 |

    [src] 424 |

    425 | 426 |

    signal.rcunwrap(x)

    427 | 428 |

    unwraps the phase and removes phase corresponding to integer lag.

    429 | 430 |

    Output matches with matlab output

    431 | 432 |

    [src] 433 |

    434 | 435 |

    signal.rcwrap(y, nd)

    436 | 437 |

    Adds phase corresponding to integer lag

    438 | 439 |

    Output matches with matlab output

    440 | 441 |

    [src] 442 |

    443 | 444 |

    signal.cceps(x)

    445 | 446 |

    1D Complex cepstral analysis 447 | Returns the cepstrum and a phase shift factor "nd" that is useful to invert the signal back.

    448 | 449 |

    Output matches with matlab output

    450 | 451 |

    [src] 452 |

    453 | 454 |

    signal.icceps(xhat,nd)

    455 | 456 |

    1D Inverse Complex cepstral analysis. 457 | Takes in the outputs of cceps to produce the input signal back

    458 | 459 |

    Output matches with matlab output

    460 | 461 |

    [src] 462 |

    463 | 464 |

    signal.rceps(x)

    465 | 466 |

    Real cepstrum and minimum phase reconstruction 467 | The real cepstrum is the inverse Fourier transform of the real logarithm of the magnitude of the Fourier transform of a sequence.

    468 | 469 |

    Output matches with matlab output

    470 | 471 |

    [src] 472 |

    473 | 474 |

    signal.dct(input)

    475 | 476 |

    1D Discrete Cosine Transform (DCT) 477 | Takes Real inputs (1D tensor of N points)

    478 | 479 |

    To see what is exactly computed, see section REDFT10 over here: 480 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    481 | 482 |

    [src] 483 |

    484 | 485 |

    signal.idct(input)

    486 | 487 |

    inverse 1D Discrete Cosine Transform (DCT) 488 | Takes Real inputs (1D tensor of N points)

    489 | 490 |

    To see what is exactly computed, see section REDFT01 over here: 491 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    492 | 493 |

    [src] 494 |

    495 | 496 |

    signal.dct2(input)

    497 | 498 |

    2D Discrete Cosine Transform (DCT) 499 | Takes Real inputs (2D tensor of NxM points)

    500 | 501 |

    To see what is exactly computed, see section REDFT10 over here: 502 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    503 | 504 |

    [src] 505 |

    506 | 507 |

    signal.idct2(input)

    508 | 509 |

    inverse 2D Discrete Cosine Transform (DCT) 510 | Takes Real inputs (2D tensor of NxM points)

    511 | 512 |

    To see what is exactly computed, see section REDFT01 over here: 513 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    514 | 515 |

    [src] 516 |

    517 | 518 |

    signal.dct3(input)

    519 | 520 |

    3D Discrete Cosine Transform (DCT) 521 | Takes Real inputs (3D tensor of NxMXP points)

    522 | 523 |

    To see what is exactly computed, see section REDFT10 over here: 524 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    525 | 526 |

    [src] 527 |

    528 | 529 |

    signal.idct3(input)

    530 | 531 |

    inverse 3D Discrete Cosine Transform (DCT) 532 | Takes Real inputs (3D tensor of NxMxP points)

    533 | 534 |

    To see what is exactly computed, see section REDFT01 over here: 535 | http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html

    536 | 537 |

    [src] 538 |

    539 | 540 |

    signal.hilbert(xr)

    541 | 542 |

    Discrete-time analytic signal using Hilbert transform 543 | Takes 1D inputs

    544 | 545 |

    Output matches with matlab output

    546 | 547 |

    Undocumented methods

    548 | 549 |

    550 | 551 |
      552 |
    • signal.typecheck(input)
    • 553 |
    554 |

    [src] 555 |

    556 | 557 |

    signal.wavelet.haar1d()

    558 | 559 |

    Haar wavelet (1D) 560 | return the phi and psi functions of a haar wavelet

    561 | 562 |

    [src] 563 |

    564 | 565 |

    signal.wavelet.daubechies1d()

    566 | 567 |

    Daubechies wavelet (1D) 568 | return the phi and psi functions of a daubechies wavelet

    569 | 570 |

    [src] 571 |

    572 | 573 |

    signal.wavelet.dwt1d(input, phi, psi, maxlevels)

    574 | 575 |

    Calculates the discrete wavelet transform, given the phi and psi functions 576 | phi and psi are functions that take the input signal and give out the 577 | scaled signal, and the wavelet coefficients respectively.

    578 | 579 |

    input - input signal 580 | \phi φ(x) - scaling function 581 | \psi ψ(x) - wavelet function 582 | [maxlevels] - maximum number of levels to recurse

    583 |
    584 |
    585 |
    586 | 587 | 588 | -------------------------------------------------------------------------------- /doc/signal/init.html: -------------------------------------------------------------------------------- 1 |

    keep the loaded C object around, so that it doesn't get garbage collected

    2 | -------------------------------------------------------------------------------- /doc/signal/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0px; 3 | font: 14px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; 4 | color: #000; 5 | font-weight: 400; 6 | } 7 | 8 | h1, h2, h3, h4, h5, h6 { 9 | color: #222; 10 | margin: 0 0 20px; 11 | } 12 | 13 | p, ul, ol, table, pre, dl { 14 | margin: 0 0 20px; 15 | } 16 | 17 | h1, h2, h3 { 18 | line-height: 1.1; 19 | } 20 | 21 | h1 { 22 | font-size: 28px; 23 | } 24 | 25 | h2 { 26 | color: #393939; 27 | } 28 | 29 | h3, h4, h5, h6 { 30 | color: #494949; 31 | } 32 | 33 | a { 34 | color: #39c; 35 | text-decoration: none; 36 | } 37 | 38 | a small { 39 | font-size: 11px; 40 | color: #777; 41 | margin-top: -0.6em; 42 | display: block; 43 | } 44 | 45 | .wrapper { 46 | width: 90%; 47 | margin: 0 auto; 48 | margin-top: 4em; 49 | } 50 | 51 | blockquote { 52 | border-left: 1px solid #e5e5e5; 53 | margin: 0; 54 | padding: 0 0 0 20px; 55 | font-style: italic; 56 | } 57 | 58 | pre code { 59 | padding: 8px 15px; 60 | border-radius: 5px; 61 | border: 1px solid #e5e5e5; 62 | overflow-x: auto; 63 | } 64 | 65 | table { 66 | width: 100%; 67 | border-collapse: collapse; 68 | } 69 | 70 | th, td { 71 | text-align: left; 72 | padding: 5px 10px; 73 | border-bottom: 1px solid #e5e5e5; 74 | } 75 | 76 | dt { 77 | color: #444; 78 | font-weight: 700; 79 | } 80 | 81 | th { 82 | color: #444; 83 | } 84 | 85 | img { 86 | max-width: 100%; 87 | } 88 | 89 | header { 90 | top: 0px; 91 | position: fixed; 92 | text-align: right; 93 | width: 100%; 94 | height: 3em; 95 | background-color: rgba(255,255,255,0.9); 96 | border: 1px solid #e5e5e5; 97 | border-width: 0 0 1px 0; 98 | } 99 | 100 | header ul { 101 | list-style: none; 102 | padding: 10; 103 | margin: 0; 104 | font-weight: 400; 105 | } 106 | 107 | header ul li { 108 | display: inline; 109 | border : 1px solid #e5e5e5; 110 | border-width: 0 1px 0 0; 111 | padding: 1em; 112 | } 113 | header ul li a { 114 | padding: 1em; 115 | } 116 | #navcontainer 117 | { 118 | float: left 119 | } 120 | 121 | #navcontainer ul 122 | { 123 | margin: 0; 124 | padding: 0; 125 | list-style-type: none; 126 | line-height: 0.8em; 127 | } 128 | 129 | .entityLink 130 | { 131 | float: right; 132 | font-size: 1em; 133 | } 134 | 135 | #navcontainer a 136 | { 137 | display: block; 138 | padding: 3px 12px 3px 8px; 139 | text-decoration: none; 140 | border-bottom: 1px solid #fff; 141 | font-weight: 500; 142 | } 143 | 144 | #navcontainer a: hover 145 | { 146 | background-color: #369; 147 | color: #FFF; 148 | } 149 | 150 | #navcontainer li li a 151 | { 152 | display: block; 153 | padding: 1px 1px 1px 20px; 154 | } 155 | 156 | #navcontainer li li li a 157 | { 158 | display: block; 159 | padding: 1px 1px 1px 30px; 160 | } 161 | 162 | #navcontainer li li li li a 163 | { 164 | display: block; 165 | padding: 1px 1px 1px 40px; 166 | text-decoration: none; 167 | border-bottom: 1px solid #fff; 168 | font-weight: normal; 169 | } 170 | 171 | section { 172 | width: 700px; 173 | float: left; 174 | padding-bottom: 50px; 175 | margin-left: 20px; 176 | } 177 | 178 | small { 179 | font-size: 11px; 180 | } 181 | 182 | hr { 183 | border: 0; 184 | background: #e5e5e5; 185 | height: 1px; 186 | } 187 | 188 | footer { 189 | width: 270px; 190 | float: left; 191 | position: fixed; 192 | bottom: 50px; 193 | } 194 | 195 | @media print, screen and (max-width: 1200px) { 196 | 197 | div.wrapper { 198 | width: 90%; 199 | } 200 | 201 | section, footer { 202 | float: none; 203 | position: static; 204 | width: auto; 205 | } 206 | 207 | } 208 | 209 | @media print, screen and (max-width: 720px) { 210 | body { 211 | word-wrap: break-word; 212 | } 213 | 214 | pre, code { 215 | word-wrap: normal; 216 | } 217 | } 218 | 219 | @media print, screen and (max-width: 480px) { 220 | div.wrapper { 221 | width: 95%; 222 | } 223 | 224 | } 225 | 226 | @media print { 227 | body { 228 | padding: 0.4in; 229 | font-size: 12pt; 230 | color: #444; 231 | } 232 | } 233 | 234 | pre.has-jax { 235 | font: 10em; 236 | font-size: 100%; 237 | background: inherit; 238 | border: inherit; 239 | } 240 | 241 | #metadata { 242 | padding-bottom: 0; 243 | } 244 | 245 | .result { 246 | border: solid 1px #e5e5e5; 247 | margin-bottom: 0.5em; 248 | padding: 0.5em; 249 | border-radius: 0.5em; 250 | } 251 | 252 | .docSection { 253 | border-bottom: solid 1px #e5e5e5; 254 | margin-bottom: 1em; 255 | overflow-x: hidden; 256 | } 257 | 258 | .searchForm { 259 | display: inline-block; 260 | } 261 | 262 | .anchor { 263 | display:block; 264 | position:relative; 265 | top:-50px; 266 | visibility: hidden; 267 | } 268 | -------------------------------------------------------------------------------- /doc/signal/wavelet.html: -------------------------------------------------------------------------------- 1 |

    [src] 2 |

    3 | 4 |

    signal.wavelet.haar1d()

    5 | 6 |

    Haar wavelet (1D) 7 | return the phi and psi functions of a haar wavelet

    8 | 9 |

    [src] 10 |

    11 | 12 |

    signal.wavelet.daubechies1d()

    13 | 14 |

    Daubechies wavelet (1D) 15 | return the phi and psi functions of a daubechies wavelet

    16 | 17 |

    [src] 18 |

    19 | 20 |

    signal.wavelet.dwt1d(input, phi, psi, maxlevels)

    21 | 22 |

    Calculates the discrete wavelet transform, given the phi and psi functions 23 | phi and psi are functions that take the input signal and give out the 24 | scaled signal, and the wavelet coefficients respectively.

    25 | 26 |

    input - input signal 27 | \phi φ(x) - scaling function 28 | \psi ψ(x) - wavelet function 29 | [maxlevels] - maximum number of levels to recurse

    30 | -------------------------------------------------------------------------------- /doc/style-page.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0px; 3 | font: 14px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; 4 | color: #000; 5 | font-weight: 400; 6 | } 7 | 8 | h1, h2, h3, h4, h5, h6 { 9 | color: #222; 10 | margin: 0 0 20px; 11 | } 12 | 13 | p, ul, ol, table, pre, dl { 14 | margin: 0 0 20px; 15 | } 16 | 17 | h1, h2, h3 { 18 | line-height: 1.1; 19 | } 20 | 21 | h1 { 22 | font-size: 28px; 23 | } 24 | 25 | h2 { 26 | color: #393939; 27 | } 28 | 29 | h3, h4, h5, h6 { 30 | color: #494949; 31 | } 32 | 33 | a { 34 | color: #39c; 35 | text-decoration: none; 36 | } 37 | 38 | a small { 39 | font-size: 11px; 40 | color: #777; 41 | margin-top: -0.6em; 42 | display: block; 43 | } 44 | 45 | .wrapper { 46 | width: 90%; 47 | margin: 0 auto; 48 | margin-top: 4em; 49 | } 50 | 51 | blockquote { 52 | border-left: 1px solid #e5e5e5; 53 | margin: 0; 54 | padding: 0 0 0 20px; 55 | font-style: italic; 56 | } 57 | 58 | pre code { 59 | padding: 8px 15px; 60 | border-radius: 5px; 61 | border: 1px solid #e5e5e5; 62 | overflow-x: auto; 63 | } 64 | 65 | table { 66 | width: 100%; 67 | border-collapse: collapse; 68 | } 69 | 70 | th, td { 71 | text-align: left; 72 | padding: 5px 10px; 73 | border-bottom: 1px solid #e5e5e5; 74 | } 75 | 76 | dt { 77 | color: #444; 78 | font-weight: 700; 79 | } 80 | 81 | th { 82 | color: #444; 83 | } 84 | 85 | img { 86 | max-width: 100%; 87 | } 88 | 89 | header { 90 | top: 0px; 91 | position: fixed; 92 | text-align: right; 93 | width: 100%; 94 | height: 3em; 95 | background-color: rgba(255,255,255,0.9); 96 | border: 1px solid #e5e5e5; 97 | border-width: 0 0 1px 0; 98 | } 99 | 100 | header ul { 101 | list-style: none; 102 | padding: 10; 103 | margin: 0; 104 | font-weight: 400; 105 | } 106 | 107 | header ul li { 108 | display: inline; 109 | border : 1px solid #e5e5e5; 110 | border-width: 0 1px 0 0; 111 | padding: 1em; 112 | } 113 | header ul li a { 114 | padding: 1em; 115 | } 116 | #navcontainer 117 | { 118 | float: left 119 | } 120 | 121 | #navcontainer ul 122 | { 123 | margin: 0; 124 | padding: 0; 125 | list-style-type: none; 126 | line-height: 0.8em; 127 | } 128 | 129 | .entityLink 130 | { 131 | float: right; 132 | font-size: 1em; 133 | } 134 | 135 | #navcontainer a 136 | { 137 | display: block; 138 | padding: 3px 12px 3px 8px; 139 | text-decoration: none; 140 | border-bottom: 1px solid #fff; 141 | font-weight: 500; 142 | } 143 | 144 | #navcontainer a: hover 145 | { 146 | background-color: #369; 147 | color: #FFF; 148 | } 149 | 150 | #navcontainer li li a 151 | { 152 | display: block; 153 | padding: 1px 1px 1px 20px; 154 | } 155 | 156 | #navcontainer li li li a 157 | { 158 | display: block; 159 | padding: 1px 1px 1px 30px; 160 | } 161 | 162 | #navcontainer li li li li a 163 | { 164 | display: block; 165 | padding: 1px 1px 1px 40px; 166 | text-decoration: none; 167 | border-bottom: 1px solid #fff; 168 | font-weight: normal; 169 | } 170 | 171 | section { 172 | width: 700px; 173 | float: left; 174 | padding-bottom: 50px; 175 | margin-left: 20px; 176 | } 177 | 178 | small { 179 | font-size: 11px; 180 | } 181 | 182 | hr { 183 | border: 0; 184 | background: #e5e5e5; 185 | height: 1px; 186 | } 187 | 188 | footer { 189 | width: 270px; 190 | float: left; 191 | position: fixed; 192 | bottom: 50px; 193 | } 194 | 195 | @media print, screen and (max-width: 1200px) { 196 | 197 | div.wrapper { 198 | width: 90%; 199 | } 200 | 201 | section, footer { 202 | float: none; 203 | position: static; 204 | width: auto; 205 | } 206 | 207 | } 208 | 209 | @media print, screen and (max-width: 720px) { 210 | body { 211 | word-wrap: break-word; 212 | } 213 | 214 | pre, code { 215 | word-wrap: normal; 216 | } 217 | } 218 | 219 | @media print, screen and (max-width: 480px) { 220 | div.wrapper { 221 | width: 95%; 222 | } 223 | 224 | } 225 | 226 | @media print { 227 | body { 228 | padding: 0.4in; 229 | font-size: 12pt; 230 | color: #444; 231 | } 232 | } 233 | 234 | pre.has-jax { 235 | font: 10em; 236 | font-size: 100%; 237 | background: inherit; 238 | border: inherit; 239 | } 240 | 241 | #metadata { 242 | padding-bottom: 0; 243 | } 244 | 245 | .result { 246 | border: solid 1px #e5e5e5; 247 | margin-bottom: 0.5em; 248 | padding: 0.5em; 249 | border-radius: 0.5em; 250 | } 251 | 252 | .docSection { 253 | border-bottom: solid 1px #e5e5e5; 254 | margin-bottom: 1em; 255 | overflow-x: hidden; 256 | } 257 | 258 | .searchForm { 259 | display: inline-block; 260 | } 261 | 262 | .anchor { 263 | display:block; 264 | position:relative; 265 | top:-50px; 266 | visibility: hidden; 267 | } 268 | -------------------------------------------------------------------------------- /doc/style.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700); 2 | 3 | body { 4 | padding:50px; 5 | font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; 6 | color:#000; 7 | font-weight:300; 8 | margin-left: auto; 9 | margin-right: auto; 10 | text-align: center; 11 | width: 80%; 12 | } 13 | 14 | h1 { 15 | color:#222; 16 | margin:0 0 20px; 17 | line-height:1.1; 18 | font-size:3em; 19 | } 20 | 21 | a { 22 | color:#39c; 23 | font-weight:400; 24 | text-decoration:none; 25 | } 26 | 27 | .packageItem { 28 | border-style: solid; 29 | border-width: 1px; 30 | border-radius: 30px; 31 | border-color: #aaa; 32 | background-image: -webkit-gradient( 33 | linear, 34 | left top, 35 | left bottom, 36 | color-stop(0.19, #FFFFFF), 37 | color-stop(1, #EDEDED) 38 | ); 39 | background-image: -o-linear-gradient(bottom, #FFFFFF 19%, #EDEDED 100%); 40 | background-image: -moz-linear-gradient(bottom, #FFFFFF 19%, #EDEDED 100%); 41 | background-image: -webkit-linear-gradient(bottom, #FFFFFF 19%, #EDEDED 100%); 42 | background-image: -ms-linear-gradient(bottom, #FFFFFF 19%, #EDEDED 100%); 43 | background-image: linear-gradient(to bottom, #FFFFFF 19%, #EDEDED 100%); 44 | padding: 0.2em; 45 | margin: 0.2em; 46 | } 47 | 48 | a > .packageItem { 49 | font-size: 2em; 50 | } 51 | .packageItem > small { 52 | font-size: 0.6em; 53 | display: block; 54 | color: #000; 55 | } 56 | 57 | .searchForm { 58 | float: right; 59 | } 60 | .packageList { 61 | column-width: 300px; 62 | -moz-column-width: 300px; 63 | -webkit-column-width: 300px; 64 | } 65 | .packageSection { 66 | -webkit-column-break-inside: avoid; 67 | break-inside: avoid-column; 68 | page-break-inside: avoid; 69 | border: 1px solid #eee; 70 | border-radius: 30px; 71 | margin-bottom: 10px; 72 | 73 | } 74 | -------------------------------------------------------------------------------- /extramath.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- some extra math functions 3 | ]]-- 4 | 5 | local xmath = {} 6 | 7 | function xmath.round(num) 8 | if num >= 0 then return math.floor(num+.5) 9 | else return math.ceil(num-.5) end 10 | end 11 | 12 | function xmath.log2(x) 13 | return math.log(x)/math.log(2) 14 | end 15 | function xmath.nextpow2(x) 16 | return math.ceil(math.log2(math.abs(x))) 17 | end 18 | return xmath 19 | -------------------------------------------------------------------------------- /ffi.lua: -------------------------------------------------------------------------------- 1 | local ffi = require 'ffi' 2 | ffi.cdef[[ 3 | void signal_conv1d_float(float *y, float *x, float *k, const long yn, const long kn, long stride); 4 | void signal_conv1d_double(double *y, double *x, double *k, const long yn, const long kn, long stride); 5 | ]] 6 | 7 | return ffi.load(package.searchpath('libsignal', package.cpath)) 8 | 9 | -------------------------------------------------------------------------------- /init.c: -------------------------------------------------------------------------------- 1 | 2 | #define TSIG_CONCAT_EXPAND(x,y,z) x ## y ## _ ## z 3 | #define TSIG_CONCAT(x,y,z) TSIG_CONCAT_EXPAND(x,y,z) 4 | #define signal_(NAME) TSIG_CONCAT(signal_,NAME, real) 5 | 6 | #define real float 7 | #include "conv.c" 8 | #undef real 9 | 10 | #define real double 11 | #include "conv.c" 12 | #undef real 13 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | require 'torch' 2 | 3 | local signal = signal or {} 4 | 5 | signal.C = require 'signal.ffi' -- keep the loaded C object around, so that it doesn't get garbage collected 6 | 7 | local convolution = require 'signal.convolution' 8 | for k,v in pairs(convolution) do 9 | signal[k] = v 10 | end 11 | 12 | local fft = require 'signal.fft' 13 | -- fft functions go into the root signal namespace 14 | for k,v in pairs(fft) do 15 | signal[k] = v 16 | end 17 | 18 | signal.wavelet = require 'signal.wavelet' 19 | 20 | signal.complex = require 'signal.complex' 21 | 22 | return signal 23 | -------------------------------------------------------------------------------- /rocks/signal-scm-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "signal" 2 | version = "scm-1" 3 | 4 | source = { 5 | url = "git://github.com/soumith/torch-signal.git" 6 | } 7 | 8 | description = { 9 | summary = "A signal processing toolbox for Torch-7", 10 | detailed = [[ 11 | A signal processing toolbox for Torch-7 12 | ]], 13 | homepage = "https://github.com/soumith/torch-signal", 14 | license = "RWTFPL" 15 | } 16 | 17 | dependencies = { 18 | "lua >= 5.1", 19 | "torch >= 7.0", 20 | "fftw3 >= 1.0" 21 | } 22 | 23 | build = { 24 | type = "command", 25 | build_command = [[ 26 | cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(LUA_BINDIR)/.." -DCMAKE_INSTALL_PREFIX="$(PREFIX)" && $(MAKE) 27 | ]], 28 | install_command = "cd build && $(MAKE) install" 29 | } 30 | -------------------------------------------------------------------------------- /tests/cceps.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | a=torch.FloatTensor({12,2,9,16}) 4 | 5 | 6 | b,nd=signal.cceps(a) 7 | c=signal.icceps(b,nd) 8 | print(a) 9 | print(b) 10 | print(c) 11 | 12 | print("Expected: 2.5213 -0.0386 -0.1402 1.3211") 13 | -------------------------------------------------------------------------------- /tests/dct.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | a=torch.FloatTensor({12,2,9,16}) 4 | 5 | b=signal.dct(a) 6 | c=signal.idct(b) 7 | print(a) 8 | print(b) 9 | print(c) 10 | 11 | a=torch.Tensor({{12,2,9,16},{12,2,9,16},{12,2,9,16}}) 12 | b=signal.dct2(a) 13 | c=signal.idct2(b) 14 | print(a) 15 | print(b) 16 | print(c) 17 | 18 | a=torch.FloatTensor({{{12,2,9,16},{12,2,9,16},{12,2,9,16}},{{12,2,9,16},{12,2,9,16},{12,2,9,16}}}) 19 | print(a) 20 | b=signal.dct3(a) 21 | c=signal.idct3(b) 22 | print(b) 23 | print(c) 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/fft.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | function sfft() 4 | print('hello') 5 | -- local input = torch.Tensor({{1,0},{2,0},{3,0},{4,0}}) 6 | -- local output = signal.fft(input) 7 | local input = torch.Tensor({1,2,3,4}) 8 | local output = signal.dct(input) 9 | print('world') 10 | end 11 | 12 | 13 | while true do 14 | sfft() 15 | collectgarbage() 16 | sfft() 17 | collectgarbage() 18 | end -------------------------------------------------------------------------------- /tests/fftM.lua: -------------------------------------------------------------------------------- 1 | require 'xlua' 2 | local signal = require 'signal' 3 | 4 | function test_fftM(A) 5 | local Af = signal.fftM(A) 6 | local Aif = signal.ifftM(A) 7 | for i=1,A:size(1) do 8 | assert((Af[i] - signal.fft(A[i])):norm() == 0) 9 | assert((Aif[i] - signal.ifft(A[i])):norm() == 0) 10 | end 11 | end 12 | 13 | -- test real tensors 14 | test_fftM(torch.randn(100,100)) 15 | print("Real tensors OK") 16 | 17 | -- test complex tensors 18 | test_fftM(torch.randn(100,100,2)) 19 | print("Complex tensors OK") 20 | 21 | -- evaluate runtime improvements 22 | local A = torch.randn(100,100) 23 | local p = xlua.Profiler() 24 | local iters = 1000 25 | 26 | p:start('single fftM') 27 | for i=1,iters do 28 | signal.fftM(A) 29 | end 30 | p:lap('single fftM', iters) 31 | 32 | p:start('multiple fft') 33 | for i=1,iters do 34 | for i=1,A:size(1) do 35 | signal.fft(A[i]) 36 | end 37 | end 38 | p:lap('multiple fft', iters) 39 | 40 | p:printAll() 41 | -------------------------------------------------------------------------------- /tests/hilbert.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | a=torch.FloatTensor({12,2,9,16}) 4 | 5 | b=signal.hilbert(a) 6 | print(a) 7 | print(b) 8 | 9 | print('expected -- 12.0000 + 7.0000i 2.0000 + 1.5000i 9.0000 - 7.0000i 16.0000 - 1.5000i') 10 | 11 | a=torch.Tensor({12,2,9,16,25}) 12 | 13 | b=signal.hilbert(a) 14 | print(a) 15 | print(b) 16 | 17 | print('expected -- 12.0000 +13.1402i 2.0000 + 0.5388i 9.0000 - 6.7285i 16.0000 - 8.3955i 25.0000 + 1.4450i') 18 | -------------------------------------------------------------------------------- /tests/poly.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | a=torch.Tensor({12,2,9,16}) 4 | 5 | 6 | b=torch.poly(a) 7 | print(a) 8 | print(b) 9 | print('-- Expected: 1 -39 518 -2616 3456') 10 | 11 | a=torch.Tensor({{12,2,9,16},{12,2,9,16},{12,2,9,16},{12,2,9,16}}) 12 | b=torch.poly(a) 13 | print(a) 14 | print(b) 15 | print('-- Expected: 1.0000 -39.0000 0.0000 0 0') 16 | -------------------------------------------------------------------------------- /tests/rceps.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | a=torch.FloatTensor({12,2,9,16}) 4 | 5 | b=signal.rceps(a) 6 | print(b) 7 | 8 | print('-- Expected: 2.5213 0.6412 -0.1402 0.6412') 9 | -------------------------------------------------------------------------------- /tests/rcunwrap.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | a=torch.FloatTensor({12,2,9,16}) 4 | 5 | b=signal.rcunwrap(a) 6 | print(b) 7 | 8 | print('-- Expected: 12.0000 6.7124 -0.4248 -7.5619') 9 | -------------------------------------------------------------------------------- /tests/rcwrap.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | a=torch.Tensor({12,2,9,16}) 4 | 5 | b=signal.rcwrap(a, 0.5) 6 | print(b) 7 | -------------------------------------------------------------------------------- /tests/rfftM.lua: -------------------------------------------------------------------------------- 1 | require 'xlua' 2 | local signal = require 'signal' 3 | 4 | function test_rfftM(A) 5 | local Af = signal.rfftM(A) 6 | for i = 1, A:size(1) do 7 | assert((Af[i] - signal.rfft(A[i])):norm() == 0) 8 | end 9 | end 10 | 11 | function test_irfftM(A) 12 | A[{{}, {1}, {2}}] = 0 -- 0th order, always real 13 | if A:size(2) % 2 == 1 then 14 | A[{{}, {-1}, {2}}] = 0 -- nyquist freq is always real 15 | end 16 | local Aif = signal.irfftM(A) 17 | for i = 1, A:size(1) do 18 | assert((Aif[i] - signal.irfft(A[i])):norm() == 0) 19 | end 20 | end 21 | 22 | -- test forward transform, both odd and even nfft 23 | test_rfftM(torch.randn(100, 100)) 24 | test_rfftM(torch.randn(100, 101)) 25 | print('rfftM OK') 26 | 27 | -- test inverse transform, both odd and even nfft 28 | test_irfftM(torch.randn(100, 100, 2)) 29 | test_irfftM(torch.randn(100, 101, 2)) 30 | print('irfftM OK') 31 | 32 | -- evaluate runtime improvements 33 | local A = torch.randn(100, 100) 34 | local p = xlua.Profiler() 35 | local iters = 1000 36 | 37 | p:start('single rfftM') 38 | for i = 1, iters do 39 | signal.rfftM(A) 40 | end 41 | p:lap('single rfftM', iters) 42 | 43 | p:start('multiple rfft') 44 | for i = 1, iters do 45 | for i = 1, A:size(1) do 46 | signal.rfft(A[i]) 47 | end 48 | end 49 | p:lap('multiple rfft', iters) 50 | 51 | -- This also offers a significant speedup over the 52 | -- signal.stft implementation, with some care. 53 | 54 | -- Define a quick and dirty stft using rfftM 55 | -- We're going to use a rectangular window. 56 | -- It'd be easy enough to allocate a window and 57 | -- and cmul the framed input windows. 58 | local function stft(input, window_size, window_stride) 59 | A = input:unfold(1, window_stride, window_size) 60 | return signal.rfftM(A) 61 | end 62 | 63 | local samples = torch.randn(16000) -- 1 s long clip @ 16 kHz 64 | local window_size = 400 -- emulate 25 ms @ 16 kHz 65 | local window_stride = 160 -- emulate 10 ms @ 16 kHz 66 | p:start('rstft using rfftM') 67 | for i = 1, iters do 68 | stft(samples, window_size, window_stride) 69 | end 70 | p:lap('rstft using rfftM') 71 | 72 | p:start('signal rstft') 73 | for i = 1, iters do 74 | signal.rstft(samples, window_size, window_stride) 75 | end 76 | p:lap('signal rstft') 77 | 78 | p:printAll() 79 | -------------------------------------------------------------------------------- /tests/stft.lua: -------------------------------------------------------------------------------- 1 | require 'audio' 2 | require 'image' 3 | local signal = require 'signal' 4 | 5 | torch.setdefaulttensortype('torch.FloatTensor') 6 | 7 | inp = audio.samplevoice():float():squeeze() 8 | print(#(inp)) 9 | stft = signal.stft(inp, 1024, 512, 'hamming') 10 | stft = signal.stft(inp, 1024, 512) 11 | stft = signal.stft(inp, 1024, 512, 'bartlett') 12 | a=os.clock() 13 | stft = signal.stft(inp, 1024, 512, 'hann') 14 | print('Time taken for stft from signal package: ' .. os.clock()-a) 15 | a=os.clock() 16 | stft2 = audio.stft(inp, 1024, 'hann', 512) 17 | print('Time taken for stft from audio package: ' .. os.clock()-a) 18 | print(#stft) 19 | -- display magnitude 20 | image.display(stft[{{1,100},{1,100},1}]) 21 | image.display(stft2[{{1,100},{stft2:size(2)-100,stft2:size(2)},1}]) 22 | 23 | spect = signal.spectrogram(inp, 1024, 512) 24 | image.display(spect) 25 | -------------------------------------------------------------------------------- /tests/test.lua: -------------------------------------------------------------------------------- 1 | local signal = require 'signal' 2 | 3 | local mytester = torch.Tester() 4 | local precision = 1e-5 5 | 6 | local signaltest = {} 7 | -- local assertcount = 0 8 | 9 | local function asserteq(a,b, err, precision) 10 | precision = precision or 1e-5 11 | local c = a-b 12 | mytester:assertlt(c, precision, err) 13 | end 14 | 15 | function signaltest.fft() 16 | do 17 | local input = torch.Tensor({{1,0},{2,0},{3,0},{4,0}}) 18 | local output = signal.fft(input) 19 | local inputi = signal.ifft(output) 20 | for i=1,input:size(1) do 21 | for j=1,input:size(2) do 22 | asserteq(input[i][j], inputi[i][j], 'error in fft+ifft') 23 | end 24 | end 25 | end 26 | do 27 | local input = torch.randn(1000,2) 28 | local output = signal.fft(input) 29 | local inputi = signal.ifft(output) 30 | for i=1,input:size(1) do 31 | asserteq(input[i][1], inputi[i][1], 'error in fft+ifft') 32 | asserteq(input[i][2], inputi[i][2], 'error in fft+ifft') 33 | end 34 | end 35 | end 36 | 37 | function signaltest.fft2() 38 | do 39 | local input = torch.Tensor(2,2,2):fill(0) 40 | input[1][1][1] = 1 41 | input[1][2][1] = 2 42 | input[2][1][1] = 3 43 | input[2][2][1] = 4 44 | local output = signal.fft2(input) 45 | local inputi = signal.ifft2(output) 46 | for i=1,input:size(1) do 47 | for j=1,input:size(2) do 48 | for k=1,input:size(3) do 49 | asserteq(input[i][j][k], inputi[i][j][k], 'error in fft2+ifft2') 50 | end 51 | end 52 | end 53 | end 54 | do 55 | local input = torch.randn(50,100,2) 56 | local output = signal.fft2(input) 57 | local inputi = signal.ifft2(output) 58 | for i=1,input:size(1) do 59 | for j=1,input:size(2) do 60 | asserteq(input[i][j][1], inputi[i][j][1], 'error in fft2+ifft2') 61 | asserteq(input[i][j][2], inputi[i][j][2], 'error in fft2+ifft2') 62 | end 63 | end 64 | end 65 | end 66 | 67 | function signaltest.rfft() 68 | local input = torch.randn(100) 69 | local output1 = signal.fft(input) 70 | local output2 = signal.rfft(input) 71 | for i=1,output1:size(1)/2+1 do 72 | asserteq(output1[i][1], output2[i][1], 'error in rfft') 73 | asserteq(output1[i][2], output2[i][2], 'error in rfft') 74 | end 75 | end 76 | 77 | function signaltest.rfft2() 78 | local input = torch.randn(100, 50) 79 | local output1 = signal.fft2(input) 80 | local output2 = signal.rfft2(input) 81 | for i=1,output1:size(1) do 82 | for j=1,output1:size(2)/2+1 do 83 | asserteq(output1[i][j][1], output2[i][j][1], 'error in rfft2', 1e-4) 84 | asserteq(output1[i][j][2], output2[i][j][2], 'error in rfft2', 1e-4) 85 | end 86 | end 87 | end 88 | 89 | function signaltest.irfft() 90 | local input = torch.randn(100) 91 | local output1 = signal.fft(input) 92 | local outputi1 = signal.ifft(output1) 93 | local output2 = signal.rfft(input) 94 | local output2_copy = output2:clone() 95 | local outputi2 = signal.irfft(output2) 96 | for i=1,outputi1:size(1) do 97 | asserteq(outputi1[i][1], outputi2[i], 'error in irfft') 98 | end 99 | for i=1,output2:size(1) do 100 | for j=1,output2:size(2) do 101 | asserteq(output2[i][j], output2_copy[i][j], 'error in preserving of irfft input') 102 | end 103 | end 104 | end 105 | 106 | function signaltest.irfft2() 107 | local input = torch.randn(100, 50) 108 | local output1 = signal.fft2(input) 109 | local outputi1 = signal.ifft2(output1) 110 | local output2 = signal.rfft2(input) 111 | local output2_copy = output2:clone() 112 | local outputi2 = signal.irfft2(output2) 113 | for i=1,outputi1:size(1) do 114 | for j=1,outputi1:size(2) do 115 | asserteq(outputi1[i][j][1], outputi2[i][j], 'error in irfft2') 116 | end 117 | end 118 | for i=1,output2:size(1) do 119 | for j=1,output2:size(2) do 120 | for k=1,output2:size(3) do 121 | asserteq(output2[i][j][k], output2_copy[i][j][k], 'error in preserving of irfft2 input') 122 | end 123 | end 124 | end 125 | end 126 | 127 | function signaltest.dct() 128 | local inp=torch.randn(10000) 129 | 130 | local out=signal.dct(inp) 131 | local inpi = signal.idct(out) 132 | for i=1,inp:size(1) do 133 | asserteq(inp[i], inpi[i], 'error in dct') 134 | end 135 | end 136 | 137 | function signaltest.dct2() 138 | local inp=torch.randn(50,100) 139 | 140 | local out=signal.dct2(inp) 141 | local inpi = signal.idct2(out) 142 | for i=1,inp:size(1) do 143 | for j=1,inp:size(2) do 144 | asserteq(inp[i][j], inpi[i][j], 'error in dct2') 145 | end 146 | end 147 | end 148 | 149 | function signaltest.dct3() 150 | local inp=torch.randn(30,20,10) 151 | 152 | local out=signal.dct3(inp) 153 | local inpi = signal.idct3(out) 154 | for i=1,inp:size(1) do 155 | for j=1,inp:size(2) do 156 | for k=1,inp:size(3) do 157 | asserteq(inp[i][j][k], inpi[i][j][k], 'error in dct3') 158 | end 159 | end 160 | end 161 | end 162 | 163 | function signaltest.rceps() 164 | local input =torch.Tensor({12,2,9,16}) 165 | local out = signal.rceps(input) 166 | asserteq(out[1], 2.52129598, 'error in rceps', 1e-5) 167 | asserteq(out[2], 0.64123734, 'error in rceps', 1e-5) 168 | asserteq(out[3], -0.14020901, 'error in rceps', 1e-5) 169 | asserteq(out[4], 0.64123734, 'error in rceps', 1e-5) 170 | end 171 | 172 | function signaltest.hilbert() 173 | -- even 174 | local a=torch.Tensor({12,2,9,16}) 175 | local b = signal.hilbert(a) 176 | -- 12.0000 + 7.0000i 2.0000 + 1.5000i 9.0000 - 7.0000i 16.0000 - 1.5000i 177 | asserteq(b[1][1] , 12.00, 'error in hilbert', 1e-5) 178 | asserteq(b[1][2] , 7.00, 'error in hilbert', 1e-5) 179 | asserteq(b[2][1] , 2.00, 'error in hilbert', 1e-5) 180 | asserteq(b[2][2] , 1.50, 'error in hilbert', 1e-5) 181 | asserteq(b[3][1] , 9.00, 'error in hilbert', 1e-5) 182 | asserteq(b[3][2] , -7.00, 'error in hilbert', 1e-5) 183 | asserteq(b[4][1] , 16.00, 'error in hilbert', 1e-5) 184 | asserteq(b[4][2] , -1.50, 'error in hilbert', 1e-5) 185 | 186 | -- odd 187 | local a=torch.Tensor({12,2,9,16,25}) 188 | local b=signal.hilbert(a) 189 | -- 12.0000 +13.1402i 2.0000 + 0.5388i 9.0000 - 6.7285i 16.0000 - 8.3955i 25.0000 + 1.4450i 190 | asserteq(b[1][1] , 12.00, 'error in hilbert', 1e-4) 191 | asserteq(b[1][2] , 13.1402, 'error in hilbert', 1e-4) 192 | asserteq(b[2][1] , 2.00, 'error in hilbert', 1e-4) 193 | asserteq(b[2][2] , 0.5388, 'error in hilbert', 1e-4) 194 | asserteq(b[3][1] , 9.00, 'error in hilbert', 1e-4) 195 | asserteq(b[3][2] , -6.7285, 'error in hilbert', 1e-4) 196 | asserteq(b[4][1] , 16.00, 'error in hilbert', 1e-4) 197 | asserteq(b[4][2] , -8.3955, 'error in hilbert', 1e-4) 198 | asserteq(b[5][1] , 25.00, 'error in hilbert', 1e-4) 199 | asserteq(b[5][2] , 1.445, 'error in hilbert', 1e-4) 200 | end 201 | 202 | function signaltest.cceps() 203 | local a=torch.Tensor({12,2,9,16}) 204 | local b,nd=signal.cceps(a) 205 | local c=signal.icceps(b,nd) 206 | -- Expected: 2.5213 -0.0386 -0.1402 1.3211 207 | asserteq(b[1] , 2.5213, 'error in cceps+icceps', 1e-4) 208 | asserteq(b[2] , -0.0386, 'error in cceps+icceps', 1e-4) 209 | asserteq(b[3] , -0.1402, 'error in cceps+icceps', 1e-4) 210 | asserteq(b[4] , 1.3211, 'error in cceps+icceps', 1e-4) 211 | 212 | for i=1,a:size(1) do 213 | asserteq(a[i] , c[i], 'error in cceps+icceps') 214 | end 215 | 216 | local a=torch.randn(1000) 217 | local b,nd=signal.cceps(a) 218 | local c=signal.icceps(b,nd) 219 | for i=1,a:size(1) do 220 | asserteq(a[i] , c[i], 'error in cceps+icceps') 221 | end 222 | end 223 | 224 | 225 | mytester:add(signaltest) 226 | 227 | print('Running tests at float precision') 228 | torch.setdefaulttensortype('torch.FloatTensor') 229 | mytester:run() 230 | 231 | print('Running tests at double precision') 232 | torch.setdefaulttensortype('torch.DoubleTensor') 233 | mytester:run() 234 | 235 | -------------------------------------------------------------------------------- /tests/unwrap.lua: -------------------------------------------------------------------------------- 1 | signal = require 'signal' 2 | 3 | a=torch.FloatTensor({12,2,9,16}) 4 | b=signal.unwrap(a) 5 | print(b) 6 | 7 | a=torch.Tensor({12,4,9,16}) 8 | b=signal.unwrap(a) 9 | print(b) 10 | 11 | a=torch.Tensor({12,8,9,16}) 12 | b=signal.unwrap(a) 13 | print(b) 14 | 15 | a=torch.Tensor({12,22,9,16}) 16 | b=signal.unwrap(a) 17 | print(b) 18 | 19 | a=torch.Tensor({12,20,9,16}) 20 | b=signal.unwrap(a) 21 | print(b) 22 | 23 | a=torch.Tensor({12,18,9,16}) 24 | b=signal.unwrap(a) 25 | print(b) 26 | -------------------------------------------------------------------------------- /tests/wavelet.lua: -------------------------------------------------------------------------------- 1 | local signal = require 'signal' 2 | 3 | torch.manualSeed(1) 4 | 5 | phi,psi = signal.wavelet.haar1d() 6 | 7 | -- input = torch.Tensor({3,1,0,4,8,6,9,9}) 8 | 9 | -- print(input) 10 | -- local output = signal.wavelet.dwt1d(input, phi, psi) 11 | -- print(output) 12 | 13 | 14 | input = torch.Tensor({32.0, 10.0, 20.0, 38.0, 37.0, 28.0, 38.0, 34.0, 18.0, 24.0, 15 | 18.0, 9.0, 23.0, 24.0, 28.0, 34.0}):float() 16 | local wavelet, scale = signal.wavelet.dwt1d(input, phi, psi) 17 | for k,v in ipairs(wavelet) do 18 | print(v) 19 | end 20 | print(wavelet) 21 | print(scale) 22 | -------------------------------------------------------------------------------- /wavelet.lua: -------------------------------------------------------------------------------- 1 | local signal = require 'signal.convolution' 2 | local xmath = require 'signal.extramath' 3 | 4 | local wavelet = {} 5 | 6 | --[[ 7 | Haar wavelet (1D) 8 | return the phi and psi functions of a haar wavelet 9 | ]]-- 10 | function wavelet.haar1d() 11 | -- phi would be convolution with a 1d kernel [1/2,1/2] and stride 2 12 | -- psi would be convolution with a 1d kernel [1/2,-1/2] and stride 2 13 | local phi_kernel = torch.Tensor({0.5,0.5}) 14 | local psi_kernel = torch.Tensor({0.5,-0.5}) 15 | 16 | local function phi(input) 17 | return signal.conv1d(input, phi_kernel:typeAs(input), 2) 18 | end 19 | local function psi(input) 20 | return signal.conv1d(input, psi_kernel:typeAs(input), 2) 21 | end 22 | return phi, psi 23 | end 24 | 25 | --[[ 26 | Daubechies wavelet (1D) 27 | return the phi and psi functions of a daubechies wavelet 28 | ]] 29 | function wavelet.daubechies1d() 30 | error('implementation not finished') 31 | -- calculate kernel 32 | -- phi(r) = ho * phi(2r) + h1 * phi(2r- 1) + h2 * phi(2r - 2) + h3 * phi(2r - 3) 33 | -- psi(r) = -ho * phi(2r- 1) + h1 * phi(2r) - h2 * phi(2r + 1) + h3 * phi(2r + 2) 34 | local function phi(input) 35 | end 36 | 37 | local function psi(input) 38 | end 39 | return phi, psi 40 | end 41 | 42 | 43 | --[[ 44 | pads a given function to the nearest upper bound power of 2. 45 | fills the padding with zeros 46 | ]]-- 47 | local function pad2(input) 48 | local input_size = input:size(1) 49 | local log2 = xmath.log2(input_size) 50 | if log2 % 2 ~= 0 then 51 | local padded_size = math.pow(2, math.ceil(log2)) 52 | local temp = torch.zeros(padded_size):typeAs(input) 53 | temp[{{1, input_size}}] = input 54 | input = temp 55 | end 56 | return input 57 | end 58 | 59 | --[[ 60 | Calculates the discrete wavelet transform, given the phi and psi functions 61 | phi and psi are functions that take the input signal and give out the 62 | scaled signal, and the wavelet coefficients respectively. 63 | 64 | input - input signal 65 | \phi φ(x) - scaling function 66 | \psi ψ(x) - wavelet function 67 | [maxlevels] - maximum number of levels to recurse 68 | ]]-- 69 | function wavelet.dwt1d(input, phi, psi, maxlevels) 70 | -- pad the input to 2^n, fill with zeros 71 | input = pad2(input) 72 | 73 | -- number of levels is log2(n) 74 | local level = level or xmath.log2(input:size(1)) 75 | 76 | local output = output or {} 77 | 78 | for lev = level, 1,-1 do 79 | if maxlevels and (level-lev) == maxlevels then break; end 80 | -- calculate wavelet coefficients with psi 81 | table.insert(output , psi(input)) 82 | -- scale the input 83 | input = phi(input) 84 | end 85 | 86 | return output, input 87 | end 88 | 89 | 90 | return wavelet 91 | --------------------------------------------------------------------------------