This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Preconditioned Conjugate Gradient | |
// 前処理付き共役勾配法 | |
// Ax = b の方程式をxについて解く手法 | |
// 前処理付き行列として Pinv * A ~ I | |
// になるような行列を渡す | |
void PCG( CvMat* A, CvMat* b, CvMat* x, CvMat* Pinv, double th); | |
void PCG( CvMat* A, CvMat* b, CvMat* x, CvMat* Pinv, double th) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "compressiveSensing.h" | |
// private functions | |
void mulA( CSstruct *cs, CvMat* x, CvMat* y); | |
void mulPinv( CSstruct *cs, CvMat* x, CvMat* y); | |
void saveMat( CvMat *mat, char filename[] ); | |
double min( double a, double b ){ | |
return ( a<b )? a : b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <cv.h> | |
#include <highgui.h> | |
#define DIM 2 // 次元 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <cv.h> | |
#include <highgui.h> | |
int main( int argc, char *argv[] ){ | |
double snr = 0.002; | |
// read file | |
if( argc == 1 ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <stdio.h> | |
#include <cv.h> | |
#include <highgui.h> | |
#include <opencv2/nonfree/nonfree.hpp> | |
#define SQUARE(x) ((x)*(x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UIView (frame) | |
@property (nonatomic, assign) CGPoint origin; | |
@property (nonatomic, assign) CGFloat left; | |
@property (nonatomic, assign) CGFloat right; | |
@property (nonatomic, assign) CGFloat top; | |
@property (nonatomic, assign) CGFloat bottom; | |
@property (nonatomic, assign) CGSize size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)rotateLabel:(UILabel* )label | |
{ | |
CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI_2); // 90度回転 | |
// アニメーションなしで回転 | |
label.transform = transform; | |
// 3.0[sec]かけて回転 | |
[UIView animateWithDuration:1.0 animations:^{ | |
label.transform = transform; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// vc1をrootにしてUINavigationControllerの初期化 | |
UIViewController *vc1 = [[UIViewController alloc] init]; | |
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:vc1]; | |
// vc2で切り替える | |
UIViewController *vc2 = [[UIViewController alloc] init]; | |
[nc setViewControllers:@[vc2]]; |
OlderNewer