ICode9

精准搜索请尝试: 精确搜索
  • Clark变换等幅值与等功率系数计算2022-02-09 22:33:38

    三相电压公式: \[U_a=U_{max}\cos{\theta}\\ U_b=U_{max}\cos{\theta-\frac{2}{3}\pi}\\ U_c=U_{max}\cos{\theta+\frac{2}{3}\pi}\\ \]\(Clakr\)变换如下: \[\left[\begin{matrix} U_α \\ U_β \\ \end{matrix}\right] =K \left[\begin{matri

  • numpy 对二维数组的常用操作2022-02-09 22:31:30

    目录 1、提取二维数组的某几列或某几行 2、获取某个范围的数据 3、所有元素求和 4、计算数组中非零元素的个数 5、使用布尔型掩码提取某些行或某些列 6、获取数组的行数或列数 7、获取最后一列(或行)的元素 1、提取二维数组的某几列或某几行 import numpy as np # 定义 3*3 的 nu

  • 旋转矩阵边界问题2022-02-09 20:05:57

    基础: list接口: List list = new ArrayList(); 方法:add;remove; 收获: 1.矩阵边界问题,关键是什么时候跳出循环; 规律是:遍历上右下左,当遍历上边时,区间就是[left,right],top++; 测试代码:想用正方形,发现无法遍历中间的横杠和竖杠,这样的边界不能明确 class Solution { public Lis

  • 分治2022-02-08 20:02:36

    分治与贪心 分治 贪心策略 step1 分:问题分解 问题分解为多个子问题 step2 治:逐个击破 子问题求局部最优解 step3 合:合并求解 局部最优解进行组合 对于分治,问题分解之后可能还需要继续分解。对于贪心策略,子问题将无需继续分解。 实列 快速排序算法就用到了分治策略

  • 85. 最大矩形2022-02-08 11:02:54

    最大矩形 给定一个仅包含 0 和 1 、大小为 rows x cols 的二维二进制矩阵,找出只包含 1 的最大矩形,并返回其面积。 示例 1: 输入:matrix = [[“1”,“0”,“1”,“0”,“0”],[“1”,“0”,“1”,“1”,“1”],[“1”,“1”,“1”,“1”,“1”],[“1”,“0”,“0”,“1”,“0”]

  • 剑指 Offer 29. 顺时针打印矩阵2022-02-08 01:02:40

    剑指 Offer 29. 顺时针打印矩阵 老面孔了,只要画图注意边界即可。 class Solution { public int[] spiralOrder(int[][] matrix) { int u = 0, d = matrix.length - 1; // 排除非矩阵的情况 if(d < 0) { return new int[]{}; }

  • 剑指offer4:二维数组中的查找2022-02-08 00:01:21

    分析: 这题,其实是可以暴力解决哒哟好像,但是除了暴力,我们可以用更加巧妙(bushi)的方法来显示自己的逼格,比如题目中给了这个matrix的性质,我们可以从右上角开始遍历,想想题目中这个栗子,我们要找5,5比15小,那么肯定不在这一列中,肯定在列数更小的右边部分对吧,那么找左边的直到4,我们发现5比

  • leetcode 73: 矩阵置零2022-02-07 15:29:59

    leetcode 73: 矩阵置零 给定一个 *m* x *n* 的矩阵,如果一个元素为 0 ,则将其所在行和列的所有元素都设为 0 。请使用 原地 算法。 示例 1: 输入:matrix = [[1,1,1],[1,0,1],[1,1,1]] 输出:[[1,0,1],[0,0,0],[1,0,1]] 示例 2: 输入:matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]] 输出:[[

  • R中Matrix and TMB package version issues2022-02-07 13:34:35

    在Rstudio中常遇到Matrix and TMB包版本的问题: 或者是其他类似的问题: Warning message: In checkMatrixPackageVersion() : Package version inconsistency detected. TMB was built with Matrix version xx.xx.xx Current Matrix version is yy.yy.yy Please re-install 'T

  • 【附C++源代码】模型预测控制(MPC)公式推导以及算法实现,Model Predictive control介绍2022-02-07 11:01:36

    2022年的第一篇博客,首先祝大家新年快乐! 提示:本篇博客主要集中在对MPC的理解以及应用。这篇博客可以作为你对MPC控制器深入研究的一个开始,起到抛砖引玉,带你快速了解其原理的作用。 这篇博客将介绍一下模型预测控制器(MPC)的公式、推导以及C++代码的实现。 主要内容如下: 从一

  • 腾讯五十题No.17 螺旋矩阵2022-02-06 21:02:18

    题目链接 二刷发现已经忘光光了。。。。 class Solution { public List<Integer> spiralOrder(int[][] matrix) { List<Integer> ans = new ArrayList<>(); //二维数组长和宽 int n = matrix.length; int m = matrix[0].length; //

  • 【PLA】基于Python实现的线性代数算法库之QR分解2022-02-06 19:02:45

    【PLA】基于Python实现的线性代数算法库之QR分解 算法包下载链接:https://download.csdn.net/download/qq_42629529/79481514 from PLA.Matrix import Matrix from PLA.GramSchmidtProcess import qr if __name__ == "__main__": #1 A1 = Matrix([[1, 1, 2],

  • 【PLA】基于Python实现的线性代数算法库之lu分解2022-02-06 18:59:10

    【PLA】基于Python实现的线性代数算法库之lu分解 算法包下载链接:https://download.csdn.net/download/qq_42629529/79481514 from .Matrix import Matrix from .Vector import Vector from ._globals import is_zero#判断是否为0 #方阵的lu分解 def lu(matrix): assert

  • Leetcode-D44-数组-48. 旋转图像&54. 螺旋矩阵(明天复习)2022-02-06 09:02:51

    一、复习 1、47. 全排列 II 写的还不错,思路大体上对,就是还是小小的调试了一下——当size=0的时候,是进不去for循环的,所以需要在size=1的时候就判断,然后直接append(path),然后return class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: d

  • 任务安排2022-02-06 09:00:39

    link 斜率优化模板题,机房特权啊啊啊! 写方程: \[f_x=\min\limits_{i=0}^{x-1}\{f_i+s\times(sc_m-sc_i)+st_x\times(sc_z-sc_i)\} \]去掉大括号和min: \[f_x=f_i+s\times(sc_m-sc_i)+st_x\times(sc_z-sc_i) \]拆开&移项: \[f_j=(s+st_i)sc_j+f_i+s\times sc_m+st_i\times sc_i \]标注

  • c++使用vector创建二维数组的方法2022-02-05 23:58:21

    c++使用vector创建二维数组的方法 一次性定义 此种方法适用于每一行的列数都相等的二维数组的定义(与初始化)。 //使用vector一次性完成二维数组的定义(注意:此种方法适用于每一行的列数相等的二维数组) vector<vector<int>> matrix(m, vector<int>(n, -1)); //以下是拆分理解 //

  • 54. 螺旋矩阵(c++)2022-02-05 23:31:03

    class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { if(matrix.size() == 0 && matrix[0].size() == 0){ return {{}}; } int left = 0, right = matrix[0].size

  • 酉矩阵/幺正矩阵(Unitary Matrix)2022-02-04 20:02:56

    酉矩阵/幺正矩阵 酉矩阵Q的列向量都是标准正交的 酉矩阵的特征值的绝对值为1 例子: 判断三阶傅里叶矩阵是否为厄米特矩阵?是否为酉矩阵? 矩阵满足 A = A

  • Leetcode面T10(1-9)数组,你了解过移动端适配吗2022-02-04 15:31:15

    // } // } // return -1; // } //二分搜索法 public int findString(String[] words, String s) { //直接二分搜索 int left = 0; int right = words.length - 1; //[left.right) while(left <= right){ while(left < words.length && words[left].equals("")){

  • C++/OpenGL 入门(9):复制同一立方体进行多物体运动2022-02-04 15:03:19

    来源:《Computer Graphics Programming in OpenGL Using C++ 》by V Scott Gordon John L Clevenger内容:程序4.1 Program 4.1 Plain Red Cube,书P78页,PDF97/403相关介绍可参考 C++/OpenGL 入门(8):画一个转动的彩色立方体结果,生成多个转动的彩色立方体,如下 C++/OpenGL 入门(

  • 54. Spiral Matrix2022-02-04 03:01:36

    This is an exactly same problem with "59. Spiral Matrix II". I set every direction as a status, when one direction was implemented, the current status turns to the next status. Which different status, the scan direction is different, but all sca

  • 59. Spiral Matrix II2022-02-04 03:01:18

    This is the same problem with https://www.cnblogs.com/feiflytech/p/15862380.html public int[][] generateMatrix(int n) { int[][] matrix = new int[n][n]; int top = 0, bottom = n - 1, left = 0, right = n - 1; int num = 1;

  • 厄米特矩阵(Hermittan Matrix)2022-02-03 22:58:19

    1.厄米特矩阵(Hermittan Matrix) 1.1 共轭转置 向量的共轭转置 矩阵的共轭转置 1.2 复向量的长度 实向量的长度 x T x

  • C++ Eigen 库的使用2022-02-03 13:01:08

    #include "ros/ros.h" #include<Eigen/Core> #include<Eigen/Geometry> // using namespace std; https://www.cnblogs.com/lovebay/p/11215028.html https://blog.csdn.net/u011092188/article/details/77430988/ // using namespace Eigen; double m

  • 力扣 面试题 01.08. 零矩阵2022-02-02 22:03:46

    题目 编写一种算法,若M × N矩阵中某个元素为0,则将其所在的行与列清零。 示例 输入: [ [1,1,1], [1,0,1], [1,1,1] ] 输出: [ [1,0,1], [0,0,0], [1,0,1] ] 输入: [ [0,1,2,0], [3,4,5,2], [1,3,1,5] ] 输出: [ [0,0,0,0], [0,4,5,0], [0,3,1,0] ] 来源:力扣(LeetCode) 链接:https://l

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有